Skip to content

feat(avm)!: add immutables_hash member to get contract instance opcode#23152

Open
IlyasRidhuan wants to merge 1 commit into
ir/05-05-feat_update_address_derivationfrom
ir/05-06-feat_avm_add_immutables_hash_member_to_get_contract_instance_opcode
Open

feat(avm)!: add immutables_hash member to get contract instance opcode#23152
IlyasRidhuan wants to merge 1 commit into
ir/05-05-feat_update_address_derivationfrom
ir/05-06-feat_avm_add_immutables_hash_member_to_get_contract_instance_opcode

Conversation

@IlyasRidhuan
Copy link
Copy Markdown
Contributor

@IlyasRidhuan IlyasRidhuan commented May 11, 2026

Part 3 of the immutables_hash changes as part of AZIP-9

This updates the GETCONTRACTINSTANCE opcode so that the immutables_hash can be retrieved from the contract instance via the opcode.

Copy link
Copy Markdown
Contributor Author

Warning

This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
Learn more

This stack of pull requests is managed by Graphite. Learn more about stacking.

@IlyasRidhuan IlyasRidhuan force-pushed the ir/05-06-feat_avm_add_immutables_hash_member_to_get_contract_instance_opcode branch from 8e47d28 to 3ae27b1 Compare May 11, 2026 16:30
@IlyasRidhuan IlyasRidhuan force-pushed the ir/05-05-feat_update_address_derivation branch 2 times, most recently from f8f8953 to 9c8d4d8 Compare May 11, 2026 16:37
@IlyasRidhuan IlyasRidhuan force-pushed the ir/05-06-feat_avm_add_immutables_hash_member_to_get_contract_instance_opcode branch 2 times, most recently from 08ca61f to ca0212d Compare May 14, 2026 18:37
@IlyasRidhuan IlyasRidhuan force-pushed the ir/05-05-feat_update_address_derivation branch from 9c8d4d8 to a91ac39 Compare May 14, 2026 18:37
@IlyasRidhuan IlyasRidhuan force-pushed the ir/05-06-feat_avm_add_immutables_hash_member_to_get_contract_instance_opcode branch from ca0212d to af6ce8c Compare May 14, 2026 19:43
@IlyasRidhuan IlyasRidhuan force-pushed the ir/05-05-feat_update_address_derivation branch 2 times, most recently from 4311e6b to 3457e34 Compare May 14, 2026 20:37
@IlyasRidhuan IlyasRidhuan force-pushed the ir/05-06-feat_avm_add_immutables_hash_member_to_get_contract_instance_opcode branch 2 times, most recently from 14be1b8 to 527035c Compare May 14, 2026 21:07
@IlyasRidhuan IlyasRidhuan force-pushed the ir/05-05-feat_update_address_derivation branch from 3457e34 to 524585d Compare May 14, 2026 21:07
@IlyasRidhuan IlyasRidhuan marked this pull request as ready for review May 15, 2026 07:46
: is_class_id ? event.retrieved_class_id
: is_init_hash ? event.retrieved_init_hash
: FF(0);
FF selected_member = is_deployer ? event.retrieved_deployer_addr
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think it would be nicer to check member_enum against ContractInstanceMember::MAX and then cast into the enum type ContractInstanceMember and using a switch.

Copy link
Copy Markdown
Contributor

@jeanmon jeanmon left a comment

Choose a reason for hiding this comment

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

I have one suggestion. Overall, it is good!

/*expectedDeployer=*/ expectContractInstance.deployer,
/*expectedClassId=*/ expectContractInstance.currentContractClassId,
/*expectedInitializationHash=*/ expectContractInstance.initializationHash,
/*expectedImmutablesHash=*/ expectContractInstance.immutablesHash,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Perfect that you thought about the bulk test! @IlyasRidhuan

@IlyasRidhuan IlyasRidhuan force-pushed the ir/05-06-feat_avm_add_immutables_hash_member_to_get_contract_instance_opcode branch from 527035c to 5879a73 Compare May 15, 2026 15:15
@IlyasRidhuan IlyasRidhuan force-pushed the ir/05-05-feat_update_address_derivation branch from 524585d to bf16019 Compare May 15, 2026 15:15
@IlyasRidhuan IlyasRidhuan force-pushed the ir/05-06-feat_avm_add_immutables_hash_member_to_get_contract_instance_opcode branch from 5879a73 to d92bdb8 Compare May 15, 2026 20:56
@IlyasRidhuan IlyasRidhuan force-pushed the ir/05-05-feat_update_address_derivation branch from bf16019 to 11df3f3 Compare May 15, 2026 20:56
@IlyasRidhuan IlyasRidhuan force-pushed the ir/05-06-feat_avm_add_immutables_hash_member_to_get_contract_instance_opcode branch from d92bdb8 to bf1da80 Compare May 15, 2026 21:39
@IlyasRidhuan IlyasRidhuan force-pushed the ir/05-05-feat_update_address_derivation branch from 11df3f3 to de4bf52 Compare May 15, 2026 21:39
@IlyasRidhuan IlyasRidhuan force-pushed the ir/05-05-feat_update_address_derivation branch from de4bf52 to 582c604 Compare May 15, 2026 21:58
@IlyasRidhuan IlyasRidhuan force-pushed the ir/05-06-feat_avm_add_immutables_hash_member_to_get_contract_instance_opcode branch from bf1da80 to 8322f9e Compare May 15, 2026 21:58
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.

3 participants