Skip to content

Commit

Permalink
feat(avm): add get_contract_instance (#6871)
Browse files Browse the repository at this point in the history
  • Loading branch information
IlyasRidhuan authored Jun 4, 2024
1 parent 3c52cac commit b3a86bf
Show file tree
Hide file tree
Showing 13 changed files with 395 additions and 237 deletions.
4 changes: 4 additions & 0 deletions barretenberg/cpp/pil/avm/avm_main.pil
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ namespace avm_main(256);
pol commit sel_op_l1_to_l2_msg_exists;
pol commit sel_op_emit_unencrypted_log;
pol commit sel_op_emit_l2_to_l1_msg;
pol commit sel_op_get_contract_instance;

pol commit sel_op_sload;
pol commit sel_op_sstore;
Expand Down Expand Up @@ -248,6 +249,7 @@ namespace avm_main(256);
sel_op_l1_to_l2_msg_exists * (1 - sel_op_l1_to_l2_msg_exists) = 0;
sel_op_emit_unencrypted_log * (1 - sel_op_emit_unencrypted_log) = 0;
sel_op_emit_l2_to_l1_msg * (1 - sel_op_emit_l2_to_l1_msg) = 0;
sel_op_get_contract_instance * (1 - sel_op_get_contract_instance) = 0;

sel_op_sload * (1 - sel_op_sload) = 0;
sel_op_sstore * (1 - sel_op_sstore) = 0;
Expand Down Expand Up @@ -578,6 +580,8 @@ namespace avm_main(256);
sel_op_emit_unencrypted_log * (avm_kernel.kernel_out_offset - (avm_kernel.START_EMIT_UNENCRYPTED_LOG_WRITE_OFFSET + avm_kernel.emit_unencrypted_log_write_offset)) = 0;
first * avm_kernel.emit_unencrypted_log_write_offset = 0;

// TODO: Add the equivalent for GETCONTRACTINSTANCE?

#[EMIT_L2_TO_L1_MSGS_KERNEL_OUTPUT]
sel_op_emit_l2_to_l1_msg * (avm_kernel.kernel_out_offset - (avm_kernel.START_EMIT_L2_TO_l1_MSG + avm_kernel.emit_l2_to_l1_msg_write_offset)) = 0;
first * avm_kernel.emit_l2_to_l1_msg_write_offset = 0;
Expand Down
Loading

0 comments on commit b3a86bf

Please sign in to comment.