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: hedera/sdks-and-apis/sdks/accounts-and-hbar/create-a-hookstore-transaction.mdx
+4-2Lines changed: 4 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -43,9 +43,11 @@ The signing requirements depend on if an `adminKey` was set when the hook was cr
43
43
|`setHookId(<HookId>)`|`HookId`|**Required.** Sets the unique identifier of the EVM Hook whose storage is being updated. |
44
44
|`addStorageUpdate(<update>)`|`EvmHookStorageUpdate`|**Optional.** Adds a single storage update (slot or mapping entry) to the transaction. |
45
45
|`setStorageUpdates(<updates>)`|`list<EvmHookStorageUpdate>`|**Optional.** Sets the full list of storage updates for the transaction. |
46
+
|`getHookId()`|`HookId`| Returns the hook ID for this transaction. |
47
+
|`getStorageUpdates()`|`list<EvmHookStorageUpdate>`| Returns the list of storage updates. |
46
48
47
49
<Note>
48
-
`EvmHookStorageUpdate` is an abstract class with two concrete implementations: `EvmHookStorageSlot` for direct slot updates and `EvmHookMappingEntries` for updating entries within a Solidity mapping. See the Hiero Hooks SDK Reference for details.
50
+
`EvmHookStorageUpdate` is an abstract class with two concrete implementations: `EvmHookStorageSlot` for direct slot updates and `EvmHookMappingEntries` for updating entries within a Solidity mapping. See [Create and Manage Hooks](/hedera/sdks-and-apis/sdks/accounts-and-hbar/create-and-manage-hooks) for full property details on both types.
49
51
</Note>
50
52
51
53
---
@@ -384,4 +386,4 @@ if err != nil {
384
386
fmt.Printf("HookStoreTransaction executed with status: %v\n", receipt.Status)
@@ -32,7 +32,11 @@ When creating a **new account** using the`AccountCreateTransaction()`API you wil
32
32
33
33
Accounts have a property, `maxAutoAssociations`, and the property's value determines the maximum number of automatic token associations allowed.
34
34
35
-
<table><thead><tr><th align="center">Property Value</th><th>Description</th></tr></thead><tbody><tr><td align="center"><code>0</code></td><td>Automatic <strong>token</strong> associations or <strong>token airdrops</strong> are not allowed, and the account must be manually associated with a token. This also applies if the value is less than or equal to <code>usedAutoAssociations</code>.</td></tr><tr><td align="center"><code>-1</code></td><td>Unlimited automatic token associations are allowed, and this is the default for accounts created via <a href="../../../core-concepts/accounts/auto-account-creation">auto account creation</a> and for accounts that began as hollow accounts and are now complete. Accounts with <code>-1</code> can receive new tokens without manually associating them. The sender still pays the <code>maxAutoAssociations</code> fee and initial rent for each association.</td></tr><tr><td align="center"><code>> 0</code></td><td>If the value is a positive number (number greater than 0), the number of automatic token associations an account can have is limited to that number.</td></tr></tbody></table>
35
+
| Property Value | Description |
36
+
| :---: | --- |
37
+
|`0`| Automatic **token** associations or **token airdrops** are not allowed, and the account must be manually associated with a token. This also applies if the value is less than or equal to `usedAutoAssociations`. |
38
+
|`-1`| Unlimited automatic token associations are allowed, and this is the default for accounts created via [auto account creation](../../../core-concepts/accounts/auto-account-creation) and for accounts that began as hollow accounts and are now complete. Accounts with `-1` can receive new tokens without manually associating them. The sender still pays the `maxAutoAssociations` fee and initial rent for each association. |
39
+
|`> 0`| If the value is a positive number (number greater than 0), the number of automatic token associations an account can have is limited to that number. |
36
40
37
41
<Info>
38
42
The sender pays the `maxAutoAssociations` fee and the rent for the first auto-renewal period for the association. This is in addition to the typical transfer fees. This ensures the receiver can receive tokens without association and makes it a smoother transfer process.
@@ -42,14 +46,33 @@ The sender pays the `maxAutoAssociations` fee and the rent for the first auto-re
If an alias is set during account creation, it becomes [immutable](/hedera/support-and-community/glossary#immutability), meaning it cannot be changed. If you plan to update or rotate keys in the future, do not set the alias at the time of initial account creation. The alias can be set after finalizing all key updates.
You can attach [Hiero Hooks](/hedera/core-concepts/accounts/hiero-hooks) to an account at creation time using `addHook()`. Hooks are programmable EVM extension points that let you enforce custom validation logic on transfers involving this account. See [Create and Manage Hooks](/hedera/sdks-and-apis/sdks/accounts-and-hbar/create-and-manage-hooks) for full details and utility class reference.
74
+
</Info>
75
+
53
76
<CodeGroup>
54
77
55
78
```java Java
@@ -159,17 +182,112 @@ println!("The new account ID is {}", new_account_id);
159
182
160
183
</CodeGroup>
161
184
185
+
#### Create an account with an EVM hook
186
+
187
+
This example creates a new account with an [account allowance hook](/hedera/core-concepts/accounts/hiero-hooks) attached. The hook contract must be deployed first via `ContractCreateTransaction`.
188
+
189
+
<CodeGroup>
190
+
191
+
```java Java
192
+
// Step 1: Deploy hook contract first (standard ContractCreateTransaction)
193
+
ContractId contractId =/* ... your deployed hook contract ... */;
0 commit comments