@recoillink/cli 0.0.0-stage → 45.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (81) hide show
  1. package/LICENSE.md +193 -0
  2. package/README.md +149 -2
  3. package/bundle/154.index.js +462 -0
  4. package/bundle/230.index.js +569 -0
  5. package/bundle/25.index.js +9569 -0
  6. package/bundle/267.index.js +1386 -0
  7. package/bundle/308.index.js +5121 -0
  8. package/bundle/367.index.js +4 -0
  9. package/bundle/369.index.js +3443 -0
  10. package/bundle/529.index.js +3596 -0
  11. package/bundle/576.index.js +36 -0
  12. package/bundle/610.index.js +86 -0
  13. package/bundle/617.index.js +1612 -0
  14. package/bundle/628.index.js +152 -0
  15. package/bundle/633.index.js +86 -0
  16. package/bundle/697.index.js +410 -0
  17. package/bundle/7183ea1c1bf0a5da980d.js +214 -0
  18. package/bundle/748.index.js +672 -0
  19. package/bundle/78.index.js +372 -0
  20. package/bundle/841.index.js +2093 -0
  21. package/bundle/868.index.js +290 -0
  22. package/bundle/902.index.js +173 -0
  23. package/bundle/956.index.js +9901 -0
  24. package/bundle/aleo_wasm.wasm +0 -0
  25. package/bundle/aleo_wasm1.wasm +0 -0
  26. package/bundle/build/Release/bigint_buffer.node +0 -0
  27. package/bundle/file.js +12 -0
  28. package/bundle/index.js +4 -0
  29. package/bundle/package.json +3 -0
  30. package/bundle/worker-pipeline.js +38 -0
  31. package/bundle/worker.js +54 -0
  32. package/bundle/worker1.js +171 -0
  33. package/bundle/worker2.js +19834 -0
  34. package/bundle/worker3.js +19834 -0
  35. package/examples/aleo/core-config.yaml +19 -0
  36. package/examples/ccip/ccip-warp-route.yaml +26 -0
  37. package/examples/ccip/multi-chain-ccip-warp-route.yaml +81 -0
  38. package/examples/chain-config.yaml +42 -0
  39. package/examples/contract-artifacts.yaml +20 -0
  40. package/examples/core-config.yaml +19 -0
  41. package/examples/cosmosnative/core-config.yaml +20 -0
  42. package/examples/cosmosnative/warp-route-deployment.yaml +21 -0
  43. package/examples/crosschain/README.md +31 -0
  44. package/examples/crosschain/cosmosnative/core-config.yaml +69 -0
  45. package/examples/crosschain/ethereum/core-config.yaml +70 -0
  46. package/examples/crosschain/radix/core-config.yaml +96 -0
  47. package/examples/fork/file-transactions.yaml +5 -0
  48. package/examples/fork/timelock-testing.yaml +36 -0
  49. package/examples/fork/warp-route-update.yaml +100 -0
  50. package/examples/hooks.yaml +70 -0
  51. package/examples/ism-advanced.yaml +33 -0
  52. package/examples/ism.yaml +13 -0
  53. package/examples/radix/core-config.yaml +29 -0
  54. package/examples/sealevel/core-config-apply.yaml +7 -0
  55. package/examples/sealevel/core-config-composite-ism.yaml +21 -0
  56. package/examples/sealevel/core-config.yaml +12 -0
  57. package/examples/sealevel/igp-hook-config.yaml +13 -0
  58. package/examples/sealevel/warp-config-routing-message-id-multisig-ism.yaml +21 -0
  59. package/examples/starknet/core-config.yaml +20 -0
  60. package/examples/submit/strategy/file-strategy.yaml +8 -0
  61. package/examples/submit/strategy/gnosis-chain-strategy.yaml +10 -0
  62. package/examples/submit/strategy/gnosis-chain-tx-builder-strategy.yaml +6 -0
  63. package/examples/submit/strategy/gnosis-strategy-avalanche.yaml +4 -0
  64. package/examples/submit/strategy/gnosis-tx-builder-ica-strategy.yaml +20 -0
  65. package/examples/submit/strategy/ica-timelock-strategy.yaml +15 -0
  66. package/examples/submit/strategy/impersonated-account-strategy.yaml +4 -0
  67. package/examples/submit/strategy/json-rpc-chain-strategy.yaml +8 -0
  68. package/examples/submit/strategy/json-rpc-ica-strategy.yaml +13 -0
  69. package/examples/submit/strategy/json-rpc-strategy.yaml +3 -0
  70. package/examples/submit/strategy/json-rpc-timelock-strategy.yaml +17 -0
  71. package/examples/submit/strategy/starknet-json-rpc-chain-strategy.yaml +11 -0
  72. package/examples/submit/transactions/anvil-transactions.yaml +10 -0
  73. package/examples/submit/transactions/avalanche-transactions.json +8 -0
  74. package/examples/submit/transactions/sepolia-transactions.json +8 -0
  75. package/examples/tron-core-config.yaml +18 -0
  76. package/examples/warp-base.yaml +24 -0
  77. package/examples/warp-config-predicate-mainnet.yaml +14 -0
  78. package/examples/warp-deployed-predicate-mainnet.yaml +19 -0
  79. package/examples/warp-ethereum.yaml +19 -0
  80. package/examples/warp-route-deployment.yaml +21 -0
  81. package/package.json +117 -3
@@ -0,0 +1,3596 @@
1
+ export const id = 529;
2
+ export const ids = [529];
3
+ export const modules = {
4
+
5
+ /***/ 29026:
6
+ /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
7
+
8
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
9
+ /* harmony export */ aE: () => (/* binding */ programRegistry)
10
+ /* harmony export */ });
11
+ /* unused harmony exports credits, dispatch_proxy, hook_manager, hyp_collateral, hyp_native, hyp_synthetic, ism_manager, mailbox, token_registry, validator_announce */
12
+ const credits = `program credits.aleo;\n\nmapping committee:\n key as address.public;\n value as committee_state.public;\n\nstruct committee_state:\n is_open as boolean;\n commission as u8;\n\nmapping delegated:\n key as address.public;\n value as u64.public;\n\nmapping metadata:\n key as address.public;\n value as u32.public;\n\nmapping bonded:\n key as address.public;\n value as bond_state.public;\n\nstruct bond_state:\n validator as address;\n microcredits as u64;\n\nmapping unbonding:\n key as address.public;\n value as unbond_state.public;\n\nstruct unbond_state:\n microcredits as u64;\n height as u32;\n\nmapping account:\n key as address.public;\n value as u64.public;\n\nmapping withdraw:\n key as address.public;\n value as address.public;\n\nmapping pool:\n key as address.public;\n value as u64.public;\n\nrecord credits:\n owner as address.private;\n microcredits as u64.private;\n\nfunction bond_validator:\n input r0 as address.public;\n input r1 as u64.public;\n input r2 as u8.public;\n assert.neq self.signer r0;\n gte r1 1000000u64 into r3;\n assert.eq r3 true;\n gt r2 100u8 into r4;\n assert.neq r4 true;\n async bond_validator self.signer r0 r1 r2 into r5;\n output r5 as credits.aleo/bond_validator.future;\n\nfinalize bond_validator:\n input r0 as address.public;\n input r1 as address.public;\n input r2 as u64.public;\n input r3 as u8.public;\n get.or_use withdraw[r0] r1 into r4;\n assert.eq r1 r4;\n cast true r3 into r5 as committee_state;\n get.or_use committee[r0] r5 into r6;\n assert.eq r3 r6.commission;\n cast r0 0u64 into r7 as bond_state;\n get.or_use bonded[r0] r7 into r8;\n assert.eq r8.validator r0;\n add r8.microcredits r2 into r9;\n cast r0 r9 into r10 as bond_state;\n get.or_use delegated[r0] 0u64 into r11;\n add r2 r11 into r12;\n gte r12 10000000000000u64 into r13;\n assert.eq r13 true;\n get account[r0] into r14;\n sub r14 r2 into r15;\n contains committee[r0] into r16;\n branch.eq r16 true to validator_in_committee;\n set r4 into withdraw[r0];\n gte r2 100000000u64 into r17;\n assert.eq r17 true;\n get.or_use metadata[aleo1qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq3ljyzc] 0u32 into r18;\n add r18 1u32 into r19;\n set r19 into metadata[aleo1qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq3ljyzc];\n contains unbonding[r0] into r20;\n assert.eq r20 false;\n position validator_in_committee;\n set r6 into committee[r0];\n set r12 into delegated[r0];\n set r10 into bonded[r0];\n set r15 into account[r0];\n\nfunction bond_public:\n input r0 as address.public;\n input r1 as address.public;\n input r2 as u64.public;\n gte r2 1000000u64 into r3;\n assert.eq r3 true;\n assert.neq self.caller r0;\n async bond_public self.caller r0 r1 r2 into r4;\n output r4 as credits.aleo/bond_public.future;\n\nfinalize bond_public:\n input r0 as address.public;\n input r1 as address.public;\n input r2 as address.public;\n input r3 as u64.public;\n get.or_use withdraw[r0] r2 into r4;\n assert.eq r2 r4;\n contains bonded[r0] into r5;\n branch.eq r5 true to continue_bond_delegator;\n set r2 into withdraw[r0];\n cast true 0u8 into r6 as committee_state;\n get.or_use committee[r1] r6 into r7;\n assert.eq r7.is_open true;\n get.or_use metadata[aleo1qgqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqanmpl0] 0u32 into r8;\n add r8 1u32 into r9;\n lte r9 100000u32 into r10;\n assert.eq r10 true;\n set r9 into metadata[aleo1qgqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqanmpl0];\n position continue_bond_delegator;\n cast r1 0u64 into r11 as bond_state;\n get.or_use bonded[r0] r11 into r12;\n assert.eq r12.validator r1;\n add r12.microcredits r3 into r13;\n gte r13 10000000000u64 into r14;\n assert.eq r14 true;\n cast r1 r13 into r15 as bond_state;\n get account[r0] into r16;\n sub r16 r3 into r17;\n get.or_use delegated[r1] 0u64 into r18;\n add r3 r18 into r19;\n contains unbonding[r1] into r20;\n assert.eq r20 false;\n set r15 into bonded[r0];\n set r17 into account[r0];\n set r19 into delegated[r1];\n\nfunction unbond_public:\n input r0 as address.public;\n input r1 as u64.public;\n async unbond_public self.caller r0 r1 into r2;\n output r2 as credits.aleo/unbond_public.future;\n\nfinalize unbond_public:\n input r0 as address.public;\n input r1 as address.public;\n input r2 as u64.public;\n add block.height 360u32 into r3;\n cast 0u64 r3 into r4 as unbond_state;\n get bonded[r1] into r5;\n get withdraw[r1] into r6;\n is.eq r0 r6 into r7;\n contains withdraw[r5.validator] into r8;\n get.or_use withdraw[r5.validator] aleo1qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq3ljyzc into r9;\n is.eq r0 r9 into r10;\n and r8 r10 into r11;\n or r7 r11 into r12;\n assert.eq r12 true;\n is.eq r5.validator r1 into r13;\n branch.eq r13 true to unbond_validator;\n get.or_use unbonding[r1] r4 into r14;\n get delegated[r5.validator] into r15;\n sub r5.microcredits r2 into r16;\n lt r16 10000000000u64 into r17;\n or r11 r17 into r18;\n ternary r18 r5.microcredits r2 into r19;\n add r14.microcredits r19 into r20;\n cast r20 r3 into r21 as unbond_state;\n set r21 into unbonding[r1];\n sub r15 r19 into r22;\n set r22 into delegated[r5.validator];\n branch.eq r18 true to remove_delegator;\n cast r5.validator r16 into r23 as bond_state;\n set r23 into bonded[r1];\n branch.eq true true to end_unbond_delegator;\n position remove_delegator;\n remove bonded[r1];\n get metadata[aleo1qgqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqanmpl0] into r24;\n sub r24 1u32 into r25;\n set r25 into metadata[aleo1qgqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqanmpl0];\n position end_unbond_delegator;\n gte r22 10000000000000u64 into r26;\n branch.eq r26 true to end;\n position unbond_validator;\n contains committee[r5.validator] into r27;\n nor r13 r27 into r28;\n branch.eq r28 true to end;\n get committee[r5.validator] into r29;\n get bonded[r5.validator] into r30;\n get delegated[r5.validator] into r31;\n lt r31 10000000000000u64 into r32;\n branch.eq r32 true to remove_validator;\n sub r31 r2 into r33;\n sub r30.microcredits r2 into r34;\n gte r34 100000000u64 into r35;\n gte r33 10000000000000u64 into r36;\n and r35 r36 into r37;\n branch.eq r37 false to remove_validator;\n get.or_use unbonding[r5.validator] r4 into r38;\n add r38.microcredits r2 into r39;\n cast r39 r3 into r40 as unbond_state;\n set r40 into unbonding[r5.validator];\n set r33 into delegated[r5.validator];\n cast r5.validator r34 into r41 as bond_state;\n set r41 into bonded[r5.validator];\n branch.eq true true to end;\n position remove_validator;\n remove committee[r5.validator];\n get metadata[aleo1qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq3ljyzc] into r42;\n sub r42 1u32 into r43;\n set r43 into metadata[aleo1qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq3ljyzc];\n sub r31 r30.microcredits into r44;\n set r44 into delegated[r5.validator];\n remove bonded[r5.validator];\n get.or_use unbonding[r5.validator] r4 into r45;\n add r30.microcredits r45.microcredits into r46;\n cast r46 r3 into r47 as unbond_state;\n set r47 into unbonding[r5.validator];\n position end;\n\nfunction claim_unbond_public:\n input r0 as address.public;\n async claim_unbond_public r0 into r1;\n output r1 as credits.aleo/claim_unbond_public.future;\n\nfinalize claim_unbond_public:\n input r0 as address.public;\n get unbonding[r0] into r1;\n gte block.height r1.height into r2;\n assert.eq r2 true;\n get withdraw[r0] into r3;\n get.or_use account[r3] 0u64 into r4;\n add r1.microcredits r4 into r5;\n set r5 into account[r3];\n remove unbonding[r0];\n contains bonded[r0] into r6;\n branch.eq r6 true to end;\n remove withdraw[r0];\n position end;\n\nfunction set_validator_state:\n input r0 as boolean.public;\n async set_validator_state self.caller r0 into r1;\n output r1 as credits.aleo/set_validator_state.future;\n\nfinalize set_validator_state:\n input r0 as address.public;\n input r1 as boolean.public;\n get committee[r0] into r2;\n cast r1 r2.commission into r3 as committee_state;\n set r3 into committee[r0];\n\nfunction transfer_public:\n input r0 as address.public;\n input r1 as u64.public;\n async transfer_public self.caller r0 r1 into r2;\n output r2 as credits.aleo/transfer_public.future;\n\nfinalize transfer_public:\n input r0 as address.public;\n input r1 as address.public;\n input r2 as u64.public;\n get account[r0] into r3;\n sub r3 r2 into r4;\n set r4 into account[r0];\n get.or_use account[r1] 0u64 into r5;\n add r5 r2 into r6;\n set r6 into account[r1];\n\nfunction transfer_public_as_signer:\n input r0 as address.public;\n input r1 as u64.public;\n async transfer_public_as_signer self.signer r0 r1 into r2;\n output r2 as credits.aleo/transfer_public_as_signer.future;\n\nfinalize transfer_public_as_signer:\n input r0 as address.public;\n input r1 as address.public;\n input r2 as u64.public;\n get account[r0] into r3;\n sub r3 r2 into r4;\n set r4 into account[r0];\n get.or_use account[r1] 0u64 into r5;\n add r5 r2 into r6;\n set r6 into account[r1];\n\nfunction transfer_private:\n input r0 as credits.record;\n input r1 as address.private;\n input r2 as u64.private;\n sub r0.microcredits r2 into r3;\n cast r1 r2 into r4 as credits.record;\n cast r0.owner r3 into r5 as credits.record;\n output r4 as credits.record;\n output r5 as credits.record;\n\nfunction transfer_private_to_public:\n input r0 as credits.record;\n input r1 as address.public;\n input r2 as u64.public;\n sub r0.microcredits r2 into r3;\n cast r0.owner r3 into r4 as credits.record;\n async transfer_private_to_public r1 r2 into r5;\n output r4 as credits.record;\n output r5 as credits.aleo/transfer_private_to_public.future;\n\nfinalize transfer_private_to_public:\n input r0 as address.public;\n input r1 as u64.public;\n get.or_use account[r0] 0u64 into r2;\n add r1 r2 into r3;\n set r3 into account[r0];\n\nfunction transfer_public_to_private:\n input r0 as address.private;\n input r1 as u64.public;\n cast r0 r1 into r2 as credits.record;\n async transfer_public_to_private self.caller r1 into r3;\n output r2 as credits.record;\n output r3 as credits.aleo/transfer_public_to_private.future;\n\nfinalize transfer_public_to_private:\n input r0 as address.public;\n input r1 as u64.public;\n get account[r0] into r2;\n sub r2 r1 into r3;\n set r3 into account[r0];\n\nfunction join:\n input r0 as credits.record;\n input r1 as credits.record;\n add r0.microcredits r1.microcredits into r2;\n cast r0.owner r2 into r3 as credits.record;\n output r3 as credits.record;\n\nfunction split:\n input r0 as credits.record;\n input r1 as u64.private;\n sub r0.microcredits r1 into r2;\n sub r2 10000u64 into r3;\n cast r0.owner r1 into r4 as credits.record;\n cast r0.owner r3 into r5 as credits.record;\n output r4 as credits.record;\n output r5 as credits.record;\n\nfunction fee_private:\n input r0 as credits.record;\n input r1 as u64.public;\n input r2 as u64.public;\n input r3 as field.public;\n assert.neq r1 0u64;\n assert.neq r3 0field;\n add r1 r2 into r4;\n sub r0.microcredits r4 into r5;\n cast r0.owner r5 into r6 as credits.record;\n output r6 as credits.record;\n\nfunction fee_public:\n input r0 as u64.public;\n input r1 as u64.public;\n input r2 as field.public;\n assert.neq r0 0u64;\n assert.neq r2 0field;\n add r0 r1 into r3;\n async fee_public self.signer r3 into r4;\n output r4 as credits.aleo/fee_public.future;\n\nfinalize fee_public:\n input r0 as address.public;\n input r1 as u64.public;\n get account[r0] into r2;\n sub r2 r1 into r3;\n set r3 into account[r0];\n\nfunction upgrade:\n input r0 as credits.record;\n lte r0.microcredits 1000000000000u64 into r1;\n assert.eq r1 true;\n cast r0.owner r0.microcredits into r2 as credits.record;\n async upgrade r0.microcredits into r3;\n output r2 as credits.record;\n output r3 as credits.aleo/upgrade.future;\n\nfinalize upgrade:\n input r0 as u64.public;\n get.or_use pool[aleo1qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq3ljyzc] 0u64 into r1;\n add r1 r0 into r2;\n lte r2 4000000000000u64 into r3;\n assert.eq r3 true;\n set r2 into pool[aleo1qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq3ljyzc];\n`;
13
+ const dispatch_proxy = `import credits.aleo;\nimport ism_manager.aleo;\nimport mailbox.aleo;\nimport hook_manager.aleo;\nprogram dispatch_proxy.aleo;\n\nstruct MailboxState:\n default_hook as address;\n required_hook as address;\n\nstruct Message:\n version as u8;\n nonce as u32;\n origin_domain as u32;\n sender as [u8; 32u32];\n destination_domain as u32;\n recipient as [u8; 32u32];\n body as [u128; 16u32];\n\nstruct EthAddress:\n bytes as [u8; 20u32];\n\nstruct Mailbox:\n local_domain as u32;\n nonce as u32;\n process_count as u32;\n default_ism as address;\n default_hook as address;\n required_hook as address;\n dispatch_proxy as address;\n mailbox_owner as address;\n\nstruct CreditAllowance:\n spender as address;\n amount as u64;\n\nstruct HookMetadata:\n gas_limit as u128;\n extra_data as [u8; 64u32];\n\nstruct Tree:\n branch as [[u128; 2u32]; 32u32];\n count as u32;\n\nstruct DomainGasConfig:\n gas_overhead as u128;\n exchange_rate as u128;\n gas_price as u128;\n\nfunction get_address:\n output dispatch_proxy.aleo as address.private;\n\nfunction dispatch:\n input r0 as MailboxState.public;\n input r1 as u32.public;\n input r2 as [u8; 32u32].public;\n input r3 as [u128; 16u32].public;\n input r4 as address.public;\n input r5 as HookMetadata.public;\n input r6 as [CreditAllowance; 4u32].public;\n assert.neq r0.default_hook aleo1qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq3ljyzc;\n assert.neq r0.required_hook aleo1qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq3ljyzc;\n is.eq r4 aleo1qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq3ljyzc into r7;\n ternary r7 r0.default_hook r4 into r8;\n call mailbox.aleo/dispatch r1 r2 r3 self.caller into r9;\n call hook_manager.aleo/post_dispatch r8 r5 r6 into r10;\n call hook_manager.aleo/post_dispatch r0.required_hook r5 r6 into r11;\n async dispatch r0 r9 r10 r11 into r12;\n output r12 as dispatch_proxy.aleo/dispatch.future;\n\nfinalize dispatch:\n input r0 as MailboxState.public;\n input r1 as mailbox.aleo/dispatch.future;\n input r2 as hook_manager.aleo/post_dispatch.future;\n input r3 as hook_manager.aleo/post_dispatch.future;\n get mailbox.aleo/mailbox[true] into r4;\n assert.eq r4.default_hook r0.default_hook;\n assert.eq r4.required_hook r0.required_hook;\n await r1;\n await r2;\n await r3;\n\nconstructor:\n assert.eq edition 0u16;\n`;
14
+ const hook_manager = `import credits.aleo;\nimport ism_manager.aleo;\nimport mailbox.aleo;\nprogram hook_manager.aleo;\n\nstruct Message:\n version as u8;\n nonce as u32;\n origin_domain as u32;\n sender as [u8; 32u32];\n destination_domain as u32;\n recipient as [u8; 32u32];\n body as [u128; 16u32];\n\nstruct CreditAllowance:\n spender as address;\n amount as u64;\n\nstruct HookMetadata:\n gas_limit as u128;\n extra_data as [u8; 64u32];\n\nstruct Tree:\n branch as [[u128; 2u32]; 32u32];\n count as u32;\n\nstruct MerkleTreeHook:\n parent as address;\n root as [u128; 2u32];\n tree as Tree;\n nonce as u32;\n\nstruct InsertedIntoTreeEvent:\n id as [u128; 2u32];\n index as u32;\n\nstruct NoopHook:\n nonce as u32;\n\nstruct InterchainGasPaymaster:\n hook_owner as address;\n nonce as u32;\n balance as u64;\n count as u32;\n\nstruct GasConfigKey:\n igp as address;\n destination as u32;\n\nstruct DomainGasConfig:\n gas_overhead as u128;\n exchange_rate as u128;\n gas_price as u128;\n\nstruct GasPaymentEvent:\n id as [u128; 2u32];\n destination_domain as u32;\n gas_amount as u128;\n payment as u64;\n index as u32;\n\nstruct HookIndexKey:\n hook as address;\n index as u32;\n\nstruct EventIndexKey:\n hook as address;\n block_height as u32;\n\nstruct EthAddress:\n bytes as [u8; 20u32];\n\nstruct Mailbox:\n local_domain as u32;\n nonce as u32;\n process_count as u32;\n default_ism as address;\n default_hook as address;\n required_hook as address;\n dispatch_proxy as address;\n mailbox_owner as address;\n\nmapping nonce:\n key as boolean.public;\n value as u32.public;\n\nmapping hooks:\n key as address.public;\n value as u8.public;\n\nmapping hook_addresses:\n key as u32.public;\n value as address.public;\n\nmapping igps:\n key as address.public;\n value as InterchainGasPaymaster.public;\n\nmapping destination_gas_configs:\n key as GasConfigKey.public;\n value as DomainGasConfig.public;\n\nmapping destination_gas_config_iter:\n key as HookIndexKey.public;\n value as GasConfigKey.public;\n\nmapping destination_gas_config_length:\n key as address.public;\n value as u32.public;\n\nmapping merkle_tree_hooks:\n key as address.public;\n value as MerkleTreeHook.public;\n\nmapping gas_payment_events:\n key as HookIndexKey.public;\n value as GasPaymentEvent.public;\n\nmapping inserted_into_tree_events:\n key as HookIndexKey.public;\n value as InsertedIntoTreeEvent.public;\n\nmapping last_event_index:\n key as EventIndexKey.public;\n value as u32.public;\n\nfunction init_noop:\n async init_noop into r0;\n output r0 as hook_manager.aleo/init_noop.future;\n\nfinalize init_noop:\n get.or_use nonce[true] 0u32 into r0;\n cast r0 into r1 as NoopHook;\n hash.bhp256 r1 into r2 as address;\n contains hooks[r2] into r3;\n not r3 into r4;\n assert.eq r4 true;\n set r2 into hook_addresses[r0];\n add r0 1u32 into r5;\n set r5 into nonce[true];\n set 0u8 into hooks[r2];\n\nfunction init_igp:\n async init_igp self.caller into r0;\n output r0 as hook_manager.aleo/init_igp.future;\n\nfinalize init_igp:\n input r0 as address.public;\n get.or_use nonce[true] 0u32 into r1;\n cast r0 r1 0u64 0u32 into r2 as InterchainGasPaymaster;\n hash.bhp256 r2 into r3 as address;\n contains hooks[r3] into r4;\n not r4 into r5;\n assert.eq r5 true;\n set r3 into hook_addresses[r1];\n add r1 1u32 into r6;\n set r6 into nonce[true];\n set 4u8 into hooks[r3];\n set r2 into igps[r3];\n\nfunction set_destination_gas_config:\n input r0 as address.public;\n input r1 as u32.public;\n input r2 as DomainGasConfig.public;\n async set_destination_gas_config r0 r1 r2 self.caller into r3;\n output r3 as hook_manager.aleo/set_destination_gas_config.future;\n\nfinalize set_destination_gas_config:\n input r0 as address.public;\n input r1 as u32.public;\n input r2 as DomainGasConfig.public;\n input r3 as address.public;\n contains igps[r0] into r4;\n assert.eq r4 true;\n get igps[r0] into r5;\n assert.eq r5.hook_owner r3;\n cast r0 r1 into r6 as GasConfigKey;\n contains destination_gas_configs[r6] into r7;\n not r7 into r8;\n branch.eq r8 false to end_then_0_0;\n get.or_use destination_gas_config_length[r0] 0u32 into r9;\n cast r0 r9 into r10 as HookIndexKey;\n set r6 into destination_gas_config_iter[r10];\n add r9 1u32 into r11;\n set r11 into destination_gas_config_length[r0];\n branch.eq true true to end_otherwise_0_1;\n position end_then_0_0;\n position end_otherwise_0_1;\n set r2 into destination_gas_configs[r6];\n\nfunction remove_destination_gas_config:\n input r0 as address.public;\n input r1 as u32.public;\n async remove_destination_gas_config r0 r1 self.caller into r2;\n output r2 as hook_manager.aleo/remove_destination_gas_config.future;\n\nfinalize remove_destination_gas_config:\n input r0 as address.public;\n input r1 as u32.public;\n input r2 as address.public;\n contains igps[r0] into r3;\n assert.eq r3 true;\n get igps[r0] into r4;\n assert.eq r4.hook_owner r2;\n cast r0 r1 into r5 as GasConfigKey;\n remove destination_gas_configs[r5];\n\nfunction claim:\n input r0 as address.private;\n input r1 as u64.private;\n call credits.aleo/transfer_public self.caller r1 into r2;\n async claim r0 self.caller r1 r2 into r3;\n output r3 as hook_manager.aleo/claim.future;\n\nfinalize claim:\n input r0 as address.public;\n input r1 as address.public;\n input r2 as u64.public;\n input r3 as credits.aleo/transfer_public.future;\n contains igps[r0] into r4;\n assert.eq r4 true;\n get igps[r0] into r5;\n assert.eq r5.hook_owner r1;\n gte r5.balance r2 into r6;\n assert.eq r6 true;\n await r3;\n sub r5.balance r2 into r7;\n cast r5.hook_owner r5.nonce r7 r5.count into r8 as InterchainGasPaymaster;\n set r8 into igps[r0];\n\nfunction pay_for_gas:\n input r0 as address.private;\n input r1 as [u128; 2u32].private;\n input r2 as u32.private;\n input r3 as u128.private;\n input r4 as u64.private;\n call credits.aleo/transfer_public_as_signer hook_manager.aleo r4 into r5;\n async pay_for_gas r0 r1 r2 r3 r4 r5 into r6;\n output r6 as hook_manager.aleo/pay_for_gas.future;\n\nfinalize pay_for_gas:\n input r0 as address.public;\n input r1 as [u128; 2u32].public;\n input r2 as u32.public;\n input r3 as u128.public;\n input r4 as u64.public;\n input r5 as credits.aleo/transfer_public_as_signer.future;\n cast r0 r2 into r6 as GasConfigKey;\n contains destination_gas_configs[r6] into r7;\n assert.eq r7 true;\n get destination_gas_configs[r6] into r8;\n mul r3 r8.gas_price into r9;\n mul r9 r8.exchange_rate into r10;\n div r10 10000000000u128 into r11;\n lte r11 18446744073709551615u128 into r12;\n assert.eq r12 true;\n cast r11 into r13 as u64;\n assert.eq r13 r4;\n await r5;\n get igps[r0] into r14;\n cast r0 r14.count into r15 as HookIndexKey;\n cast r1 r2 r3 r4 r14.count into r16 as GasPaymentEvent;\n set r16 into gas_payment_events[r15];\n cast r0 block.height into r17 as EventIndexKey;\n set r14.count into last_event_index[r17];\n add r14.balance r4 into r18;\n add r14.count 1u32 into r19;\n cast r14.hook_owner r14.nonce r18 r19 into r20 as InterchainGasPaymaster;\n set r20 into igps[r0];\n\nfunction transfer_igp_ownership:\n input r0 as address.private;\n input r1 as address.private;\n async transfer_igp_ownership r0 self.caller r1 into r2;\n output r2 as hook_manager.aleo/transfer_igp_ownership.future;\n\nfinalize transfer_igp_ownership:\n input r0 as address.public;\n input r1 as address.public;\n input r2 as address.public;\n contains igps[r0] into r3;\n assert.eq r3 true;\n get igps[r0] into r4;\n assert.eq r4.hook_owner r1;\n cast r2 r4.nonce r4.balance r4.count into r5 as InterchainGasPaymaster;\n set r5 into igps[r0];\n\nfunction init_merkle_tree:\n input r0 as address.private;\n async init_merkle_tree r0 into r1;\n output r1 as hook_manager.aleo/init_merkle_tree.future;\n\nfinalize init_merkle_tree:\n input r0 as address.public;\n get.or_use nonce[true] 0u32 into r1;\n cast 0u128 0u128 into r2 as [u128; 2u32];\n cast 200636014418684474793900124069647889069u128 241087320001230136080519585693436229163u128 into r3 as [u128; 2u32];\n cast 93974531276030024843854739648391266740u128 63871773629875849864439396521971482176u128 into r4 as [u128; 2u32];\n cast 66294067272630431583104841350689447201u128 177756802695730322470865725932422475556u128 into r5 as [u128; 2u32];\n cast 17747458619593854979588589471465572325u128 91154039873745303917061774773470934559u128 into r6 as [u128; 2u32];\n cast 41440521891025744745128838831940743182u128 60894629520669430433793374864326529801u128 into r7 as [u128; 2u32];\n cast 59903522946444936989019680377850199176u128 138372656349779401676123096700574490028u128 into r8 as [u128; 2u32];\n cast 3180262733561280138502805056821254143u128 174708888174609290132996609679840034611u128 into r9 as [u128; 2u32];\n cast 48455171203811811641967620231072081816u128 233066451124647651551022141310218850885u128 into r10 as [u128; 2u32];\n cast 334080689485914854275740245880500189902u128 298184847794429370937316245747346618882u128 into r11 as [u128; 2u32];\n cast 282653557140816677488147447345498217721u128 220339046210024952190566302967731665406u128 into r12 as [u128; 2u32];\n cast 145672768088204442335147548738764583416u128 195359773238112912523174698163665391889u128 into r13 as [u128; 2u32];\n cast 21418297075731751014499913670238572596u128 208490304233564026108050214927462029255u128 into r14 as [u128; 2u32];\n cast 281404733672930043025800266103516225473u128 249742050973351594617409037165098847317u128 into r15 as [u128; 2u32];\n cast 289879148739902069907218623618383439708u128 272153760179965878774948581978868862730u128 into r16 as [u128; 2u32];\n cast 293159551140992943817529578958841871322u128 279338235662809517033392482105447374970u128 into r17 as [u128; 2u32];\n cast 322093384055859711002317835595919209255u128 42000488150413793222910142038008516924u128 into r18 as [u128; 2u32];\n cast 122254499464535460357349615889605317601u128 163409875357997099341612933566874181274u128 into r19 as [u128; 2u32];\n cast 59132542617709958082991564676137889114u128 213307109849065044721731388145721391918u128 into r20 as [u128; 2u32];\n cast 81821347195604723027123097456320473780u128 213231151757453664031032733501577239314u128 into r21 as [u128; 2u32];\n cast 336114429845119848727407931190249152198u128 301360598096960973755532425519001651903u128 into r22 as [u128; 2u32];\n cast 320542506166910886628941017057425965556u128 289604304606881051317113816162407361165u128 into r23 as [u128; 2u32];\n cast 270315001578019215236444169667452771418u128 159359836010757059645879798671718049365u128 into r24 as [u128; 2u32];\n cast 222279943939488608983982977534856788045u128 110191212380795297761298100413926971842u128 into r25 as [u128; 2u32];\n cast 133196525511722763539122868050171643853u128 317818349342580659794271157815744496524u128 into r26 as [u128; 2u32];\n cast 155004929552231825612177418997554921226u128 187928388822560161625857840976354543861u128 into r27 as [u128; 2u32];\n cast 133005247855215888074055167590444355000u128 277185228623223348062409148812927309868u128 into r28 as [u128; 2u32];\n cast 297025694464961376815096585744545123459u128 40897156374938635533147054173498873588u128 into r29 as [u128; 2u32];\n cast 6336040213458809633392154838101667430u128 62367222880804479430297662353502398838u128 into r30 as [u128; 2u32];\n cast 202117996738898010692652600915964103224u128 46042986625269866222220954975551057138u128 into r31 as [u128; 2u32];\n cast 85413120008009180910770793363078390675u128 71567477878241302074513460496530530059u128 into r32 as [u128; 2u32];\n cast 297864792032486788802704391190316402820u128 225086078672275754295496924647458870974u128 into r33 as [u128; 2u32];\n cast r2 r3 r4 r5 r6 r7 r8 r9 r10 r11 r12 r13 r14 r15 r16 r17 r18 r19 r20 r21 r22 r23 r24 r25 r26 r27 r28 r29 r30 r31 r32 r33 into r34 as [[u128; 2u32]; 32u32];\n cast r34 0u32 into r35 as Tree;\n cast 96697620089336775378094670865426525735u128 116761479129358376777137895554163725990u128 into r36 as [u128; 2u32];\n cast r0 r36 r35 r1 into r37 as MerkleTreeHook;\n hash.bhp256 r37 into r38 as address;\n contains hooks[r38] into r39;\n not r39 into r40;\n assert.eq r40 true;\n set r38 into hook_addresses[r1];\n add r1 1u32 into r41;\n set r41 into nonce[true];\n set 3u8 into hooks[r38];\n set r37 into merkle_tree_hooks[r38];\n\nfunction post_dispatch:\n input r0 as address.public;\n input r1 as HookMetadata.public;\n input r2 as [CreditAllowance; 4u32].public;\n is.eq r2[0u32].spender r0 into r3;\n ternary r3 r2[0u32].amount 0u64 into r4;\n is.eq r2[1u32].spender r0 into r5;\n ternary r5 r2[1u32].amount r4 into r6;\n is.eq r2[2u32].spender r0 into r7;\n ternary r7 r2[2u32].amount r6 into r8;\n is.eq r2[3u32].spender r0 into r9;\n ternary r9 r2[3u32].amount r8 into r10;\n call credits.aleo/transfer_public_as_signer hook_manager.aleo r10 into r11;\n async post_dispatch r0 r1 self.caller r10 r11 into r12;\n output r12 as hook_manager.aleo/post_dispatch.future;\n\nfinalize post_dispatch:\n input r0 as address.public;\n input r1 as HookMetadata.public;\n input r2 as address.public;\n input r3 as u64.public;\n input r4 as credits.aleo/transfer_public_as_signer.future;\n contains hooks[r0] into r5;\n assert.eq r5 true;\n get hooks[r0] into r6;\n await r4;\n get mailbox.aleo/mailbox[true] into r7;\n gt r7.nonce 0u32 into r8;\n assert.eq r8 true;\n sub r7.nonce 1u32 into r9;\n get mailbox.aleo/dispatch_events[r9] into r10;\n sub r7.nonce 1u32 into r11;\n get mailbox.aleo/dispatch_id_events[r11] into r12;\n cast r0 block.height into r13 as EventIndexKey;\n is.eq r6 3u8 into r14;\n branch.eq r14 false to end_then_0_2;\n get merkle_tree_hooks[r0] into r15;\n assert.eq r15.parent r2;\n lt r15.tree.count 4294967295u32 into r16;\n assert.eq r16 true;\n add r15.tree.count 1u32 into r17;\n and r17 1u32 into r18;\n gt r18 0u32 into r19;\n not false into r20;\n and r19 r20 into r21;\n cast r15.tree.branch[0u32] r15.tree.branch[1u32] r15.tree.branch[2u32] r15.tree.branch[3u32] r15.tree.branch[4u32] r15.tree.branch[5u32] r15.tree.branch[6u32] r15.tree.branch[7u32] r15.tree.branch[8u32] r15.tree.branch[9u32] r15.tree.branch[10u32] r15.tree.branch[11u32] r15.tree.branch[12u32] r15.tree.branch[13u32] r15.tree.branch[14u32] r15.tree.branch[15u32] r15.tree.branch[16u32] r15.tree.branch[17u32] r15.tree.branch[18u32] r15.tree.branch[19u32] r15.tree.branch[20u32] r15.tree.branch[21u32] r15.tree.branch[22u32] r15.tree.branch[23u32] r15.tree.branch[24u32] r15.tree.branch[25u32] r15.tree.branch[26u32] r15.tree.branch[27u32] r15.tree.branch[28u32] r15.tree.branch[29u32] r15.tree.branch[30u32] r15.tree.branch[31u32] into r22 as [[u128; 2u32]; 32u32];\n cast r22[0u32][0u32] r22[0u32][1u32] r12[0u32] r12[1u32] into r23 as [u128; 4u32];\n hash.keccak256.native.raw r23 into r24 as [boolean; 256u32];\n deserialize.bits.raw r24 ([boolean; 256u32]) into r25 ([u128; 2u32]);\n div r17 2u32 into r26;\n ternary r21 r12[0u32] r15.tree.branch[0u32][0u32] into r27;\n ternary r21 r12[1u32] r15.tree.branch[0u32][1u32] into r28;\n cast r27 r28 into r29 as [u128; 2u32];\n ternary r21 true false into r30;\n ternary r21 r12[0u32] r25[0u32] into r31;\n ternary r21 r12[1u32] r25[1u32] into r32;\n cast r31 r32 into r33 as [u128; 2u32];\n ternary r21 r17 r26 into r34;\n and r34 1u32 into r35;\n gt r35 0u32 into r36;\n not r30 into r37;\n and r36 r37 into r38;\n cast r29 r15.tree.branch[1u32] r15.tree.branch[2u32] r15.tree.branch[3u32] r15.tree.branch[4u32] r15.tree.branch[5u32] r15.tree.branch[6u32] r15.tree.branch[7u32] r15.tree.branch[8u32] r15.tree.branch[9u32] r15.tree.branch[10u32] r15.tree.branch[11u32] r15.tree.branch[12u32] r15.tree.branch[13u32] r15.tree.branch[14u32] r15.tree.branch[15u32] r15.tree.branch[16u32] r15.tree.branch[17u32] r15.tree.branch[18u32] r15.tree.branch[19u32] r15.tree.branch[20u32] r15.tree.branch[21u32] r15.tree.branch[22u32] r15.tree.branch[23u32] r15.tree.branch[24u32] r15.tree.branch[25u32] r15.tree.branch[26u32] r15.tree.branch[27u32] r15.tree.branch[28u32] r15.tree.branch[29u32] r15.tree.branch[30u32] r15.tree.branch[31u32] into r39 as [[u128; 2u32]; 32u32];\n cast r39[1u32][0u32] r39[1u32][1u32] r33[0u32] r33[1u32] into r40 as [u128; 4u32];\n hash.keccak256.native.raw r40 into r41 as [boolean; 256u32];\n deserialize.bits.raw r41 ([boolean; 256u32]) into r42 ([u128; 2u32]);\n div r34 2u32 into r43;\n ternary r38 r33[0u32] r15.tree.branch[1u32][0u32] into r44;\n ternary r38 r33[1u32] r15.tree.branch[1u32][1u32] into r45;\n cast r44 r45 into r46 as [u128; 2u32];\n ternary r38 true r30 into r47;\n ternary r38 r33[0u32] r42[0u32] into r48;\n ternary r38 r33[1u32] r42[1u32] into r49;\n cast r48 r49 into r50 as [u128; 2u32];\n ternary r38 r34 r43 into r51;\n and r51 1u32 into r52;\n gt r52 0u32 into r53;\n not r47 into r54;\n and r53 r54 into r55;\n cast r29 r46 r15.tree.branch[2u32] r15.tree.branch[3u32] r15.tree.branch[4u32] r15.tree.branch[5u32] r15.tree.branch[6u32] r15.tree.branch[7u32] r15.tree.branch[8u32] r15.tree.branch[9u32] r15.tree.branch[10u32] r15.tree.branch[11u32] r15.tree.branch[12u32] r15.tree.branch[13u32] r15.tree.branch[14u32] r15.tree.branch[15u32] r15.tree.branch[16u32] r15.tree.branch[17u32] r15.tree.branch[18u32] r15.tree.branch[19u32] r15.tree.branch[20u32] r15.tree.branch[21u32] r15.tree.branch[22u32] r15.tree.branch[23u32] r15.tree.branch[24u32] r15.tree.branch[25u32] r15.tree.branch[26u32] r15.tree.branch[27u32] r15.tree.branch[28u32] r15.tree.branch[29u32] r15.tree.branch[30u32] r15.tree.branch[31u32] into r56 as [[u128; 2u32]; 32u32];\n cast r56[2u32][0u32] r56[2u32][1u32] r50[0u32] r50[1u32] into r57 as [u128; 4u32];\n hash.keccak256.native.raw r57 into r58 as [boolean; 256u32];\n deserialize.bits.raw r58 ([boolean; 256u32]) into r59 ([u128; 2u32]);\n div r51 2u32 into r60;\n ternary r55 r50[0u32] r15.tree.branch[2u32][0u32] into r61;\n ternary r55 r50[1u32] r15.tree.branch[2u32][1u32] into r62;\n cast r61 r62 into r63 as [u128; 2u32];\n ternary r55 true r47 into r64;\n ternary r55 r50[0u32] r59[0u32] into r65;\n ternary r55 r50[1u32] r59[1u32] into r66;\n cast r65 r66 into r67 as [u128; 2u32];\n ternary r55 r51 r60 into r68;\n and r68 1u32 into r69;\n gt r69 0u32 into r70;\n not r64 into r71;\n and r70 r71 into r72;\n cast r29 r46 r63 r15.tree.branch[3u32] r15.tree.branch[4u32] r15.tree.branch[5u32] r15.tree.branch[6u32] r15.tree.branch[7u32] r15.tree.branch[8u32] r15.tree.branch[9u32] r15.tree.branch[10u32] r15.tree.branch[11u32] r15.tree.branch[12u32] r15.tree.branch[13u32] r15.tree.branch[14u32] r15.tree.branch[15u32] r15.tree.branch[16u32] r15.tree.branch[17u32] r15.tree.branch[18u32] r15.tree.branch[19u32] r15.tree.branch[20u32] r15.tree.branch[21u32] r15.tree.branch[22u32] r15.tree.branch[23u32] r15.tree.branch[24u32] r15.tree.branch[25u32] r15.tree.branch[26u32] r15.tree.branch[27u32] r15.tree.branch[28u32] r15.tree.branch[29u32] r15.tree.branch[30u32] r15.tree.branch[31u32] into r73 as [[u128; 2u32]; 32u32];\n cast r73[3u32][0u32] r73[3u32][1u32] r67[0u32] r67[1u32] into r74 as [u128; 4u32];\n hash.keccak256.native.raw r74 into r75 as [boolean; 256u32];\n deserialize.bits.raw r75 ([boolean; 256u32]) into r76 ([u128; 2u32]);\n div r68 2u32 into r77;\n ternary r72 r67[0u32] r15.tree.branch[3u32][0u32] into r78;\n ternary r72 r67[1u32] r15.tree.branch[3u32][1u32] into r79;\n cast r78 r79 into r80 as [u128; 2u32];\n ternary r72 true r64 into r81;\n ternary r72 r67[0u32] r76[0u32] into r82;\n ternary r72 r67[1u32] r76[1u32] into r83;\n cast r82 r83 into r84 as [u128; 2u32];\n ternary r72 r68 r77 into r85;\n and r85 1u32 into r86;\n gt r86 0u32 into r87;\n not r81 into r88;\n and r87 r88 into r89;\n cast r29 r46 r63 r80 r15.tree.branch[4u32] r15.tree.branch[5u32] r15.tree.branch[6u32] r15.tree.branch[7u32] r15.tree.branch[8u32] r15.tree.branch[9u32] r15.tree.branch[10u32] r15.tree.branch[11u32] r15.tree.branch[12u32] r15.tree.branch[13u32] r15.tree.branch[14u32] r15.tree.branch[15u32] r15.tree.branch[16u32] r15.tree.branch[17u32] r15.tree.branch[18u32] r15.tree.branch[19u32] r15.tree.branch[20u32] r15.tree.branch[21u32] r15.tree.branch[22u32] r15.tree.branch[23u32] r15.tree.branch[24u32] r15.tree.branch[25u32] r15.tree.branch[26u32] r15.tree.branch[27u32] r15.tree.branch[28u32] r15.tree.branch[29u32] r15.tree.branch[30u32] r15.tree.branch[31u32] into r90 as [[u128; 2u32]; 32u32];\n cast r90[4u32][0u32] r90[4u32][1u32] r84[0u32] r84[1u32] into r91 as [u128; 4u32];\n hash.keccak256.native.raw r91 into r92 as [boolean; 256u32];\n deserialize.bits.raw r92 ([boolean; 256u32]) into r93 ([u128; 2u32]);\n div r85 2u32 into r94;\n ternary r89 r84[0u32] r15.tree.branch[4u32][0u32] into r95;\n ternary r89 r84[1u32] r15.tree.branch[4u32][1u32] into r96;\n cast r95 r96 into r97 as [u128; 2u32];\n ternary r89 true r81 into r98;\n ternary r89 r84[0u32] r93[0u32] into r99;\n ternary r89 r84[1u32] r93[1u32] into r100;\n cast r99 r100 into r101 as [u128; 2u32];\n ternary r89 r85 r94 into r102;\n and r102 1u32 into r103;\n gt r103 0u32 into r104;\n not r98 into r105;\n and r104 r105 into r106;\n cast r29 r46 r63 r80 r97 r15.tree.branch[5u32] r15.tree.branch[6u32] r15.tree.branch[7u32] r15.tree.branch[8u32] r15.tree.branch[9u32] r15.tree.branch[10u32] r15.tree.branch[11u32] r15.tree.branch[12u32] r15.tree.branch[13u32] r15.tree.branch[14u32] r15.tree.branch[15u32] r15.tree.branch[16u32] r15.tree.branch[17u32] r15.tree.branch[18u32] r15.tree.branch[19u32] r15.tree.branch[20u32] r15.tree.branch[21u32] r15.tree.branch[22u32] r15.tree.branch[23u32] r15.tree.branch[24u32] r15.tree.branch[25u32] r15.tree.branch[26u32] r15.tree.branch[27u32] r15.tree.branch[28u32] r15.tree.branch[29u32] r15.tree.branch[30u32] r15.tree.branch[31u32] into r107 as [[u128; 2u32]; 32u32];\n cast r107[5u32][0u32] r107[5u32][1u32] r101[0u32] r101[1u32] into r108 as [u128; 4u32];\n hash.keccak256.native.raw r108 into r109 as [boolean; 256u32];\n deserialize.bits.raw r109 ([boolean; 256u32]) into r110 ([u128; 2u32]);\n div r102 2u32 into r111;\n ternary r106 r101[0u32] r15.tree.branch[5u32][0u32] into r112;\n ternary r106 r101[1u32] r15.tree.branch[5u32][1u32] into r113;\n cast r112 r113 into r114 as [u128; 2u32];\n ternary r106 true r98 into r115;\n ternary r106 r101[0u32] r110[0u32] into r116;\n ternary r106 r101[1u32] r110[1u32] into r117;\n cast r116 r117 into r118 as [u128; 2u32];\n ternary r106 r102 r111 into r119;\n and r119 1u32 into r120;\n gt r120 0u32 into r121;\n not r115 into r122;\n and r121 r122 into r123;\n cast r29 r46 r63 r80 r97 r114 r15.tree.branch[6u32] r15.tree.branch[7u32] r15.tree.branch[8u32] r15.tree.branch[9u32] r15.tree.branch[10u32] r15.tree.branch[11u32] r15.tree.branch[12u32] r15.tree.branch[13u32] r15.tree.branch[14u32] r15.tree.branch[15u32] r15.tree.branch[16u32] r15.tree.branch[17u32] r15.tree.branch[18u32] r15.tree.branch[19u32] r15.tree.branch[20u32] r15.tree.branch[21u32] r15.tree.branch[22u32] r15.tree.branch[23u32] r15.tree.branch[24u32] r15.tree.branch[25u32] r15.tree.branch[26u32] r15.tree.branch[27u32] r15.tree.branch[28u32] r15.tree.branch[29u32] r15.tree.branch[30u32] r15.tree.branch[31u32] into r124 as [[u128; 2u32]; 32u32];\n cast r124[6u32][0u32] r124[6u32][1u32] r118[0u32] r118[1u32] into r125 as [u128; 4u32];\n hash.keccak256.native.raw r125 into r126 as [boolean; 256u32];\n deserialize.bits.raw r126 ([boolean; 256u32]) into r127 ([u128; 2u32]);\n div r119 2u32 into r128;\n ternary r123 r118[0u32] r15.tree.branch[6u32][0u32] into r129;\n ternary r123 r118[1u32] r15.tree.branch[6u32][1u32] into r130;\n cast r129 r130 into r131 as [u128; 2u32];\n ternary r123 true r115 into r132;\n ternary r123 r118[0u32] r127[0u32] into r133;\n ternary r123 r118[1u32] r127[1u32] into r134;\n cast r133 r134 into r135 as [u128; 2u32];\n ternary r123 r119 r128 into r136;\n and r136 1u32 into r137;\n gt r137 0u32 into r138;\n not r132 into r139;\n and r138 r139 into r140;\n cast r29 r46 r63 r80 r97 r114 r131 r15.tree.branch[7u32] r15.tree.branch[8u32] r15.tree.branch[9u32] r15.tree.branch[10u32] r15.tree.branch[11u32] r15.tree.branch[12u32] r15.tree.branch[13u32] r15.tree.branch[14u32] r15.tree.branch[15u32] r15.tree.branch[16u32] r15.tree.branch[17u32] r15.tree.branch[18u32] r15.tree.branch[19u32] r15.tree.branch[20u32] r15.tree.branch[21u32] r15.tree.branch[22u32] r15.tree.branch[23u32] r15.tree.branch[24u32] r15.tree.branch[25u32] r15.tree.branch[26u32] r15.tree.branch[27u32] r15.tree.branch[28u32] r15.tree.branch[29u32] r15.tree.branch[30u32] r15.tree.branch[31u32] into r141 as [[u128; 2u32]; 32u32];\n cast r141[7u32][0u32] r141[7u32][1u32] r135[0u32] r135[1u32] into r142 as [u128; 4u32];\n hash.keccak256.native.raw r142 into r143 as [boolean; 256u32];\n deserialize.bits.raw r143 ([boolean; 256u32]) into r144 ([u128; 2u32]);\n div r136 2u32 into r145;\n ternary r140 r135[0u32] r15.tree.branch[7u32][0u32] into r146;\n ternary r140 r135[1u32] r15.tree.branch[7u32][1u32] into r147;\n cast r146 r147 into r148 as [u128; 2u32];\n ternary r140 true r132 into r149;\n ternary r140 r135[0u32] r144[0u32] into r150;\n ternary r140 r135[1u32] r144[1u32] into r151;\n cast r150 r151 into r152 as [u128; 2u32];\n ternary r140 r136 r145 into r153;\n and r153 1u32 into r154;\n gt r154 0u32 into r155;\n not r149 into r156;\n and r155 r156 into r157;\n cast r29 r46 r63 r80 r97 r114 r131 r148 r15.tree.branch[8u32] r15.tree.branch[9u32] r15.tree.branch[10u32] r15.tree.branch[11u32] r15.tree.branch[12u32] r15.tree.branch[13u32] r15.tree.branch[14u32] r15.tree.branch[15u32] r15.tree.branch[16u32] r15.tree.branch[17u32] r15.tree.branch[18u32] r15.tree.branch[19u32] r15.tree.branch[20u32] r15.tree.branch[21u32] r15.tree.branch[22u32] r15.tree.branch[23u32] r15.tree.branch[24u32] r15.tree.branch[25u32] r15.tree.branch[26u32] r15.tree.branch[27u32] r15.tree.branch[28u32] r15.tree.branch[29u32] r15.tree.branch[30u32] r15.tree.branch[31u32] into r158 as [[u128; 2u32]; 32u32];\n cast r158[8u32][0u32] r158[8u32][1u32] r152[0u32] r152[1u32] into r159 as [u128; 4u32];\n hash.keccak256.native.raw r159 into r160 as [boolean; 256u32];\n deserialize.bits.raw r160 ([boolean; 256u32]) into r161 ([u128; 2u32]);\n div r153 2u32 into r162;\n ternary r157 r152[0u32] r15.tree.branch[8u32][0u32] into r163;\n ternary r157 r152[1u32] r15.tree.branch[8u32][1u32] into r164;\n cast r163 r164 into r165 as [u128; 2u32];\n ternary r157 true r149 into r166;\n ternary r157 r152[0u32] r161[0u32] into r167;\n ternary r157 r152[1u32] r161[1u32] into r168;\n cast r167 r168 into r169 as [u128; 2u32];\n ternary r157 r153 r162 into r170;\n and r170 1u32 into r171;\n gt r171 0u32 into r172;\n not r166 into r173;\n and r172 r173 into r174;\n cast r29 r46 r63 r80 r97 r114 r131 r148 r165 r15.tree.branch[9u32] r15.tree.branch[10u32] r15.tree.branch[11u32] r15.tree.branch[12u32] r15.tree.branch[13u32] r15.tree.branch[14u32] r15.tree.branch[15u32] r15.tree.branch[16u32] r15.tree.branch[17u32] r15.tree.branch[18u32] r15.tree.branch[19u32] r15.tree.branch[20u32] r15.tree.branch[21u32] r15.tree.branch[22u32] r15.tree.branch[23u32] r15.tree.branch[24u32] r15.tree.branch[25u32] r15.tree.branch[26u32] r15.tree.branch[27u32] r15.tree.branch[28u32] r15.tree.branch[29u32] r15.tree.branch[30u32] r15.tree.branch[31u32] into r175 as [[u128; 2u32]; 32u32];\n cast r175[9u32][0u32] r175[9u32][1u32] r169[0u32] r169[1u32] into r176 as [u128; 4u32];\n hash.keccak256.native.raw r176 into r177 as [boolean; 256u32];\n deserialize.bits.raw r177 ([boolean; 256u32]) into r178 ([u128; 2u32]);\n div r170 2u32 into r179;\n ternary r174 r169[0u32] r15.tree.branch[9u32][0u32] into r180;\n ternary r174 r169[1u32] r15.tree.branch[9u32][1u32] into r181;\n cast r180 r181 into r182 as [u128; 2u32];\n ternary r174 true r166 into r183;\n ternary r174 r169[0u32] r178[0u32] into r184;\n ternary r174 r169[1u32] r178[1u32] into r185;\n cast r184 r185 into r186 as [u128; 2u32];\n ternary r174 r170 r179 into r187;\n and r187 1u32 into r188;\n gt r188 0u32 into r189;\n not r183 into r190;\n and r189 r190 into r191;\n cast r29 r46 r63 r80 r97 r114 r131 r148 r165 r182 r15.tree.branch[10u32] r15.tree.branch[11u32] r15.tree.branch[12u32] r15.tree.branch[13u32] r15.tree.branch[14u32] r15.tree.branch[15u32] r15.tree.branch[16u32] r15.tree.branch[17u32] r15.tree.branch[18u32] r15.tree.branch[19u32] r15.tree.branch[20u32] r15.tree.branch[21u32] r15.tree.branch[22u32] r15.tree.branch[23u32] r15.tree.branch[24u32] r15.tree.branch[25u32] r15.tree.branch[26u32] r15.tree.branch[27u32] r15.tree.branch[28u32] r15.tree.branch[29u32] r15.tree.branch[30u32] r15.tree.branch[31u32] into r192 as [[u128; 2u32]; 32u32];\n cast r192[10u32][0u32] r192[10u32][1u32] r186[0u32] r186[1u32] into r193 as [u128; 4u32];\n hash.keccak256.native.raw r193 into r194 as [boolean; 256u32];\n deserialize.bits.raw r194 ([boolean; 256u32]) into r195 ([u128; 2u32]);\n div r187 2u32 into r196;\n ternary r191 r186[0u32] r15.tree.branch[10u32][0u32] into r197;\n ternary r191 r186[1u32] r15.tree.branch[10u32][1u32] into r198;\n cast r197 r198 into r199 as [u128; 2u32];\n ternary r191 true r183 into r200;\n ternary r191 r186[0u32] r195[0u32] into r201;\n ternary r191 r186[1u32] r195[1u32] into r202;\n cast r201 r202 into r203 as [u128; 2u32];\n ternary r191 r187 r196 into r204;\n and r204 1u32 into r205;\n gt r205 0u32 into r206;\n not r200 into r207;\n and r206 r207 into r208;\n cast r29 r46 r63 r80 r97 r114 r131 r148 r165 r182 r199 r15.tree.branch[11u32] r15.tree.branch[12u32] r15.tree.branch[13u32] r15.tree.branch[14u32] r15.tree.branch[15u32] r15.tree.branch[16u32] r15.tree.branch[17u32] r15.tree.branch[18u32] r15.tree.branch[19u32] r15.tree.branch[20u32] r15.tree.branch[21u32] r15.tree.branch[22u32] r15.tree.branch[23u32] r15.tree.branch[24u32] r15.tree.branch[25u32] r15.tree.branch[26u32] r15.tree.branch[27u32] r15.tree.branch[28u32] r15.tree.branch[29u32] r15.tree.branch[30u32] r15.tree.branch[31u32] into r209 as [[u128; 2u32]; 32u32];\n cast r209[11u32][0u32] r209[11u32][1u32] r203[0u32] r203[1u32] into r210 as [u128; 4u32];\n hash.keccak256.native.raw r210 into r211 as [boolean; 256u32];\n deserialize.bits.raw r211 ([boolean; 256u32]) into r212 ([u128; 2u32]);\n div r204 2u32 into r213;\n ternary r208 r203[0u32] r15.tree.branch[11u32][0u32] into r214;\n ternary r208 r203[1u32] r15.tree.branch[11u32][1u32] into r215;\n cast r214 r215 into r216 as [u128; 2u32];\n ternary r208 true r200 into r217;\n ternary r208 r203[0u32] r212[0u32] into r218;\n ternary r208 r203[1u32] r212[1u32] into r219;\n cast r218 r219 into r220 as [u128; 2u32];\n ternary r208 r204 r213 into r221;\n and r221 1u32 into r222;\n gt r222 0u32 into r223;\n not r217 into r224;\n and r223 r224 into r225;\n cast r29 r46 r63 r80 r97 r114 r131 r148 r165 r182 r199 r216 r15.tree.branch[12u32] r15.tree.branch[13u32] r15.tree.branch[14u32] r15.tree.branch[15u32] r15.tree.branch[16u32] r15.tree.branch[17u32] r15.tree.branch[18u32] r15.tree.branch[19u32] r15.tree.branch[20u32] r15.tree.branch[21u32] r15.tree.branch[22u32] r15.tree.branch[23u32] r15.tree.branch[24u32] r15.tree.branch[25u32] r15.tree.branch[26u32] r15.tree.branch[27u32] r15.tree.branch[28u32] r15.tree.branch[29u32] r15.tree.branch[30u32] r15.tree.branch[31u32] into r226 as [[u128; 2u32]; 32u32];\n cast r226[12u32][0u32] r226[12u32][1u32] r220[0u32] r220[1u32] into r227 as [u128; 4u32];\n hash.keccak256.native.raw r227 into r228 as [boolean; 256u32];\n deserialize.bits.raw r228 ([boolean; 256u32]) into r229 ([u128; 2u32]);\n div r221 2u32 into r230;\n ternary r225 r220[0u32] r15.tree.branch[12u32][0u32] into r231;\n ternary r225 r220[1u32] r15.tree.branch[12u32][1u32] into r232;\n cast r231 r232 into r233 as [u128; 2u32];\n ternary r225 true r217 into r234;\n ternary r225 r220[0u32] r229[0u32] into r235;\n ternary r225 r220[1u32] r229[1u32] into r236;\n cast r235 r236 into r237 as [u128; 2u32];\n ternary r225 r221 r230 into r238;\n and r238 1u32 into r239;\n gt r239 0u32 into r240;\n not r234 into r241;\n and r240 r241 into r242;\n cast r29 r46 r63 r80 r97 r114 r131 r148 r165 r182 r199 r216 r233 r15.tree.branch[13u32] r15.tree.branch[14u32] r15.tree.branch[15u32] r15.tree.branch[16u32] r15.tree.branch[17u32] r15.tree.branch[18u32] r15.tree.branch[19u32] r15.tree.branch[20u32] r15.tree.branch[21u32] r15.tree.branch[22u32] r15.tree.branch[23u32] r15.tree.branch[24u32] r15.tree.branch[25u32] r15.tree.branch[26u32] r15.tree.branch[27u32] r15.tree.branch[28u32] r15.tree.branch[29u32] r15.tree.branch[30u32] r15.tree.branch[31u32] into r243 as [[u128; 2u32]; 32u32];\n cast r243[13u32][0u32] r243[13u32][1u32] r237[0u32] r237[1u32] into r244 as [u128; 4u32];\n hash.keccak256.native.raw r244 into r245 as [boolean; 256u32];\n deserialize.bits.raw r245 ([boolean; 256u32]) into r246 ([u128; 2u32]);\n div r238 2u32 into r247;\n ternary r242 r237[0u32] r15.tree.branch[13u32][0u32] into r248;\n ternary r242 r237[1u32] r15.tree.branch[13u32][1u32] into r249;\n cast r248 r249 into r250 as [u128; 2u32];\n ternary r242 true r234 into r251;\n ternary r242 r237[0u32] r246[0u32] into r252;\n ternary r242 r237[1u32] r246[1u32] into r253;\n cast r252 r253 into r254 as [u128; 2u32];\n ternary r242 r238 r247 into r255;\n and r255 1u32 into r256;\n gt r256 0u32 into r257;\n not r251 into r258;\n and r257 r258 into r259;\n cast r29 r46 r63 r80 r97 r114 r131 r148 r165 r182 r199 r216 r233 r250 r15.tree.branch[14u32] r15.tree.branch[15u32] r15.tree.branch[16u32] r15.tree.branch[17u32] r15.tree.branch[18u32] r15.tree.branch[19u32] r15.tree.branch[20u32] r15.tree.branch[21u32] r15.tree.branch[22u32] r15.tree.branch[23u32] r15.tree.branch[24u32] r15.tree.branch[25u32] r15.tree.branch[26u32] r15.tree.branch[27u32] r15.tree.branch[28u32] r15.tree.branch[29u32] r15.tree.branch[30u32] r15.tree.branch[31u32] into r260 as [[u128; 2u32]; 32u32];\n cast r260[14u32][0u32] r260[14u32][1u32] r254[0u32] r254[1u32] into r261 as [u128; 4u32];\n hash.keccak256.native.raw r261 into r262 as [boolean; 256u32];\n deserialize.bits.raw r262 ([boolean; 256u32]) into r263 ([u128; 2u32]);\n div r255 2u32 into r264;\n ternary r259 r254[0u32] r15.tree.branch[14u32][0u32] into r265;\n ternary r259 r254[1u32] r15.tree.branch[14u32][1u32] into r266;\n cast r265 r266 into r267 as [u128; 2u32];\n ternary r259 true r251 into r268;\n ternary r259 r254[0u32] r263[0u32] into r269;\n ternary r259 r254[1u32] r263[1u32] into r270;\n cast r269 r270 into r271 as [u128; 2u32];\n ternary r259 r255 r264 into r272;\n and r272 1u32 into r273;\n gt r273 0u32 into r274;\n not r268 into r275;\n and r274 r275 into r276;\n cast r29 r46 r63 r80 r97 r114 r131 r148 r165 r182 r199 r216 r233 r250 r267 r15.tree.branch[15u32] r15.tree.branch[16u32] r15.tree.branch[17u32] r15.tree.branch[18u32] r15.tree.branch[19u32] r15.tree.branch[20u32] r15.tree.branch[21u32] r15.tree.branch[22u32] r15.tree.branch[23u32] r15.tree.branch[24u32] r15.tree.branch[25u32] r15.tree.branch[26u32] r15.tree.branch[27u32] r15.tree.branch[28u32] r15.tree.branch[29u32] r15.tree.branch[30u32] r15.tree.branch[31u32] into r277 as [[u128; 2u32]; 32u32];\n cast r277[15u32][0u32] r277[15u32][1u32] r271[0u32] r271[1u32] into r278 as [u128; 4u32];\n hash.keccak256.native.raw r278 into r279 as [boolean; 256u32];\n deserialize.bits.raw r279 ([boolean; 256u32]) into r280 ([u128; 2u32]);\n div r272 2u32 into r281;\n ternary r276 r271[0u32] r15.tree.branch[15u32][0u32] into r282;\n ternary r276 r271[1u32] r15.tree.branch[15u32][1u32] into r283;\n cast r282 r283 into r284 as [u128; 2u32];\n ternary r276 true r268 into r285;\n ternary r276 r271[0u32] r280[0u32] into r286;\n ternary r276 r271[1u32] r280[1u32] into r287;\n cast r286 r287 into r288 as [u128; 2u32];\n ternary r276 r272 r281 into r289;\n and r289 1u32 into r290;\n gt r290 0u32 into r291;\n not r285 into r292;\n and r291 r292 into r293;\n cast r29 r46 r63 r80 r97 r114 r131 r148 r165 r182 r199 r216 r233 r250 r267 r284 r15.tree.branch[16u32] r15.tree.branch[17u32] r15.tree.branch[18u32] r15.tree.branch[19u32] r15.tree.branch[20u32] r15.tree.branch[21u32] r15.tree.branch[22u32] r15.tree.branch[23u32] r15.tree.branch[24u32] r15.tree.branch[25u32] r15.tree.branch[26u32] r15.tree.branch[27u32] r15.tree.branch[28u32] r15.tree.branch[29u32] r15.tree.branch[30u32] r15.tree.branch[31u32] into r294 as [[u128; 2u32]; 32u32];\n cast r294[16u32][0u32] r294[16u32][1u32] r288[0u32] r288[1u32] into r295 as [u128; 4u32];\n hash.keccak256.native.raw r295 into r296 as [boolean; 256u32];\n deserialize.bits.raw r296 ([boolean; 256u32]) into r297 ([u128; 2u32]);\n div r289 2u32 into r298;\n ternary r293 r288[0u32] r15.tree.branch[16u32][0u32] into r299;\n ternary r293 r288[1u32] r15.tree.branch[16u32][1u32] into r300;\n cast r299 r300 into r301 as [u128; 2u32];\n ternary r293 true r285 into r302;\n ternary r293 r288[0u32] r297[0u32] into r303;\n ternary r293 r288[1u32] r297[1u32] into r304;\n cast r303 r304 into r305 as [u128; 2u32];\n ternary r293 r289 r298 into r306;\n and r306 1u32 into r307;\n gt r307 0u32 into r308;\n not r302 into r309;\n and r308 r309 into r310;\n cast r29 r46 r63 r80 r97 r114 r131 r148 r165 r182 r199 r216 r233 r250 r267 r284 r301 r15.tree.branch[17u32] r15.tree.branch[18u32] r15.tree.branch[19u32] r15.tree.branch[20u32] r15.tree.branch[21u32] r15.tree.branch[22u32] r15.tree.branch[23u32] r15.tree.branch[24u32] r15.tree.branch[25u32] r15.tree.branch[26u32] r15.tree.branch[27u32] r15.tree.branch[28u32] r15.tree.branch[29u32] r15.tree.branch[30u32] r15.tree.branch[31u32] into r311 as [[u128; 2u32]; 32u32];\n cast r311[17u32][0u32] r311[17u32][1u32] r305[0u32] r305[1u32] into r312 as [u128; 4u32];\n hash.keccak256.native.raw r312 into r313 as [boolean; 256u32];\n deserialize.bits.raw r313 ([boolean; 256u32]) into r314 ([u128; 2u32]);\n div r306 2u32 into r315;\n ternary r310 r305[0u32] r15.tree.branch[17u32][0u32] into r316;\n ternary r310 r305[1u32] r15.tree.branch[17u32][1u32] into r317;\n cast r316 r317 into r318 as [u128; 2u32];\n ternary r310 true r302 into r319;\n ternary r310 r305[0u32] r314[0u32] into r320;\n ternary r310 r305[1u32] r314[1u32] into r321;\n cast r320 r321 into r322 as [u128; 2u32];\n ternary r310 r306 r315 into r323;\n and r323 1u32 into r324;\n gt r324 0u32 into r325;\n not r319 into r326;\n and r325 r326 into r327;\n cast r29 r46 r63 r80 r97 r114 r131 r148 r165 r182 r199 r216 r233 r250 r267 r284 r301 r318 r15.tree.branch[18u32] r15.tree.branch[19u32] r15.tree.branch[20u32] r15.tree.branch[21u32] r15.tree.branch[22u32] r15.tree.branch[23u32] r15.tree.branch[24u32] r15.tree.branch[25u32] r15.tree.branch[26u32] r15.tree.branch[27u32] r15.tree.branch[28u32] r15.tree.branch[29u32] r15.tree.branch[30u32] r15.tree.branch[31u32] into r328 as [[u128; 2u32]; 32u32];\n cast r328[18u32][0u32] r328[18u32][1u32] r322[0u32] r322[1u32] into r329 as [u128; 4u32];\n hash.keccak256.native.raw r329 into r330 as [boolean; 256u32];\n deserialize.bits.raw r330 ([boolean; 256u32]) into r331 ([u128; 2u32]);\n div r323 2u32 into r332;\n ternary r327 r322[0u32] r15.tree.branch[18u32][0u32] into r333;\n ternary r327 r322[1u32] r15.tree.branch[18u32][1u32] into r334;\n cast r333 r334 into r335 as [u128; 2u32];\n ternary r327 true r319 into r336;\n ternary r327 r322[0u32] r331[0u32] into r337;\n ternary r327 r322[1u32] r331[1u32] into r338;\n cast r337 r338 into r339 as [u128; 2u32];\n ternary r327 r323 r332 into r340;\n and r340 1u32 into r341;\n gt r341 0u32 into r342;\n not r336 into r343;\n and r342 r343 into r344;\n cast r29 r46 r63 r80 r97 r114 r131 r148 r165 r182 r199 r216 r233 r250 r267 r284 r301 r318 r335 r15.tree.branch[19u32] r15.tree.branch[20u32] r15.tree.branch[21u32] r15.tree.branch[22u32] r15.tree.branch[23u32] r15.tree.branch[24u32] r15.tree.branch[25u32] r15.tree.branch[26u32] r15.tree.branch[27u32] r15.tree.branch[28u32] r15.tree.branch[29u32] r15.tree.branch[30u32] r15.tree.branch[31u32] into r345 as [[u128; 2u32]; 32u32];\n cast r345[19u32][0u32] r345[19u32][1u32] r339[0u32] r339[1u32] into r346 as [u128; 4u32];\n hash.keccak256.native.raw r346 into r347 as [boolean; 256u32];\n deserialize.bits.raw r347 ([boolean; 256u32]) into r348 ([u128; 2u32]);\n div r340 2u32 into r349;\n ternary r344 r339[0u32] r15.tree.branch[19u32][0u32] into r350;\n ternary r344 r339[1u32] r15.tree.branch[19u32][1u32] into r351;\n cast r350 r351 into r352 as [u128; 2u32];\n ternary r344 true r336 into r353;\n ternary r344 r339[0u32] r348[0u32] into r354;\n ternary r344 r339[1u32] r348[1u32] into r355;\n cast r354 r355 into r356 as [u128; 2u32];\n ternary r344 r340 r349 into r357;\n and r357 1u32 into r358;\n gt r358 0u32 into r359;\n not r353 into r360;\n and r359 r360 into r361;\n cast r29 r46 r63 r80 r97 r114 r131 r148 r165 r182 r199 r216 r233 r250 r267 r284 r301 r318 r335 r352 r15.tree.branch[20u32] r15.tree.branch[21u32] r15.tree.branch[22u32] r15.tree.branch[23u32] r15.tree.branch[24u32] r15.tree.branch[25u32] r15.tree.branch[26u32] r15.tree.branch[27u32] r15.tree.branch[28u32] r15.tree.branch[29u32] r15.tree.branch[30u32] r15.tree.branch[31u32] into r362 as [[u128; 2u32]; 32u32];\n cast r362[20u32][0u32] r362[20u32][1u32] r356[0u32] r356[1u32] into r363 as [u128; 4u32];\n hash.keccak256.native.raw r363 into r364 as [boolean; 256u32];\n deserialize.bits.raw r364 ([boolean; 256u32]) into r365 ([u128; 2u32]);\n div r357 2u32 into r366;\n ternary r361 r356[0u32] r15.tree.branch[20u32][0u32] into r367;\n ternary r361 r356[1u32] r15.tree.branch[20u32][1u32] into r368;\n cast r367 r368 into r369 as [u128; 2u32];\n ternary r361 true r353 into r370;\n ternary r361 r356[0u32] r365[0u32] into r371;\n ternary r361 r356[1u32] r365[1u32] into r372;\n cast r371 r372 into r373 as [u128; 2u32];\n ternary r361 r357 r366 into r374;\n and r374 1u32 into r375;\n gt r375 0u32 into r376;\n not r370 into r377;\n and r376 r377 into r378;\n cast r29 r46 r63 r80 r97 r114 r131 r148 r165 r182 r199 r216 r233 r250 r267 r284 r301 r318 r335 r352 r369 r15.tree.branch[21u32] r15.tree.branch[22u32] r15.tree.branch[23u32] r15.tree.branch[24u32] r15.tree.branch[25u32] r15.tree.branch[26u32] r15.tree.branch[27u32] r15.tree.branch[28u32] r15.tree.branch[29u32] r15.tree.branch[30u32] r15.tree.branch[31u32] into r379 as [[u128; 2u32]; 32u32];\n cast r379[21u32][0u32] r379[21u32][1u32] r373[0u32] r373[1u32] into r380 as [u128; 4u32];\n hash.keccak256.native.raw r380 into r381 as [boolean; 256u32];\n deserialize.bits.raw r381 ([boolean; 256u32]) into r382 ([u128; 2u32]);\n div r374 2u32 into r383;\n ternary r378 r373[0u32] r15.tree.branch[21u32][0u32] into r384;\n ternary r378 r373[1u32] r15.tree.branch[21u32][1u32] into r385;\n cast r384 r385 into r386 as [u128; 2u32];\n ternary r378 true r370 into r387;\n ternary r378 r373[0u32] r382[0u32] into r388;\n ternary r378 r373[1u32] r382[1u32] into r389;\n cast r388 r389 into r390 as [u128; 2u32];\n ternary r378 r374 r383 into r391;\n and r391 1u32 into r392;\n gt r392 0u32 into r393;\n not r387 into r394;\n and r393 r394 into r395;\n cast r29 r46 r63 r80 r97 r114 r131 r148 r165 r182 r199 r216 r233 r250 r267 r284 r301 r318 r335 r352 r369 r386 r15.tree.branch[22u32] r15.tree.branch[23u32] r15.tree.branch[24u32] r15.tree.branch[25u32] r15.tree.branch[26u32] r15.tree.branch[27u32] r15.tree.branch[28u32] r15.tree.branch[29u32] r15.tree.branch[30u32] r15.tree.branch[31u32] into r396 as [[u128; 2u32]; 32u32];\n cast r396[22u32][0u32] r396[22u32][1u32] r390[0u32] r390[1u32] into r397 as [u128; 4u32];\n hash.keccak256.native.raw r397 into r398 as [boolean; 256u32];\n deserialize.bits.raw r398 ([boolean; 256u32]) into r399 ([u128; 2u32]);\n div r391 2u32 into r400;\n ternary r395 r390[0u32] r15.tree.branch[22u32][0u32] into r401;\n ternary r395 r390[1u32] r15.tree.branch[22u32][1u32] into r402;\n cast r401 r402 into r403 as [u128; 2u32];\n ternary r395 true r387 into r404;\n ternary r395 r390[0u32] r399[0u32] into r405;\n ternary r395 r390[1u32] r399[1u32] into r406;\n cast r405 r406 into r407 as [u128; 2u32];\n ternary r395 r391 r400 into r408;\n and r408 1u32 into r409;\n gt r409 0u32 into r410;\n not r404 into r411;\n and r410 r411 into r412;\n cast r29 r46 r63 r80 r97 r114 r131 r148 r165 r182 r199 r216 r233 r250 r267 r284 r301 r318 r335 r352 r369 r386 r403 r15.tree.branch[23u32] r15.tree.branch[24u32] r15.tree.branch[25u32] r15.tree.branch[26u32] r15.tree.branch[27u32] r15.tree.branch[28u32] r15.tree.branch[29u32] r15.tree.branch[30u32] r15.tree.branch[31u32] into r413 as [[u128; 2u32]; 32u32];\n cast r413[23u32][0u32] r413[23u32][1u32] r407[0u32] r407[1u32] into r414 as [u128; 4u32];\n hash.keccak256.native.raw r414 into r415 as [boolean; 256u32];\n deserialize.bits.raw r415 ([boolean; 256u32]) into r416 ([u128; 2u32]);\n div r408 2u32 into r417;\n ternary r412 r407[0u32] r15.tree.branch[23u32][0u32] into r418;\n ternary r412 r407[1u32] r15.tree.branch[23u32][1u32] into r419;\n cast r418 r419 into r420 as [u128; 2u32];\n ternary r412 true r404 into r421;\n ternary r412 r407[0u32] r416[0u32] into r422;\n ternary r412 r407[1u32] r416[1u32] into r423;\n cast r422 r423 into r424 as [u128; 2u32];\n ternary r412 r408 r417 into r425;\n and r425 1u32 into r426;\n gt r426 0u32 into r427;\n not r421 into r428;\n and r427 r428 into r429;\n cast r29 r46 r63 r80 r97 r114 r131 r148 r165 r182 r199 r216 r233 r250 r267 r284 r301 r318 r335 r352 r369 r386 r403 r420 r15.tree.branch[24u32] r15.tree.branch[25u32] r15.tree.branch[26u32] r15.tree.branch[27u32] r15.tree.branch[28u32] r15.tree.branch[29u32] r15.tree.branch[30u32] r15.tree.branch[31u32] into r430 as [[u128; 2u32]; 32u32];\n cast r430[24u32][0u32] r430[24u32][1u32] r424[0u32] r424[1u32] into r431 as [u128; 4u32];\n hash.keccak256.native.raw r431 into r432 as [boolean; 256u32];\n deserialize.bits.raw r432 ([boolean; 256u32]) into r433 ([u128; 2u32]);\n div r425 2u32 into r434;\n ternary r429 r424[0u32] r15.tree.branch[24u32][0u32] into r435;\n ternary r429 r424[1u32] r15.tree.branch[24u32][1u32] into r436;\n cast r435 r436 into r437 as [u128; 2u32];\n ternary r429 true r421 into r438;\n ternary r429 r424[0u32] r433[0u32] into r439;\n ternary r429 r424[1u32] r433[1u32] into r440;\n cast r439 r440 into r441 as [u128; 2u32];\n ternary r429 r425 r434 into r442;\n and r442 1u32 into r443;\n gt r443 0u32 into r444;\n not r438 into r445;\n and r444 r445 into r446;\n cast r29 r46 r63 r80 r97 r114 r131 r148 r165 r182 r199 r216 r233 r250 r267 r284 r301 r318 r335 r352 r369 r386 r403 r420 r437 r15.tree.branch[25u32] r15.tree.branch[26u32] r15.tree.branch[27u32] r15.tree.branch[28u32] r15.tree.branch[29u32] r15.tree.branch[30u32] r15.tree.branch[31u32] into r447 as [[u128; 2u32]; 32u32];\n cast r447[25u32][0u32] r447[25u32][1u32] r441[0u32] r441[1u32] into r448 as [u128; 4u32];\n hash.keccak256.native.raw r448 into r449 as [boolean; 256u32];\n deserialize.bits.raw r449 ([boolean; 256u32]) into r450 ([u128; 2u32]);\n div r442 2u32 into r451;\n ternary r446 r441[0u32] r15.tree.branch[25u32][0u32] into r452;\n ternary r446 r441[1u32] r15.tree.branch[25u32][1u32] into r453;\n cast r452 r453 into r454 as [u128; 2u32];\n ternary r446 true r438 into r455;\n ternary r446 r441[0u32] r450[0u32] into r456;\n ternary r446 r441[1u32] r450[1u32] into r457;\n cast r456 r457 into r458 as [u128; 2u32];\n ternary r446 r442 r451 into r459;\n and r459 1u32 into r460;\n gt r460 0u32 into r461;\n not r455 into r462;\n and r461 r462 into r463;\n cast r29 r46 r63 r80 r97 r114 r131 r148 r165 r182 r199 r216 r233 r250 r267 r284 r301 r318 r335 r352 r369 r386 r403 r420 r437 r454 r15.tree.branch[26u32] r15.tree.branch[27u32] r15.tree.branch[28u32] r15.tree.branch[29u32] r15.tree.branch[30u32] r15.tree.branch[31u32] into r464 as [[u128; 2u32]; 32u32];\n cast r464[26u32][0u32] r464[26u32][1u32] r458[0u32] r458[1u32] into r465 as [u128; 4u32];\n hash.keccak256.native.raw r465 into r466 as [boolean; 256u32];\n deserialize.bits.raw r466 ([boolean; 256u32]) into r467 ([u128; 2u32]);\n div r459 2u32 into r468;\n ternary r463 r458[0u32] r15.tree.branch[26u32][0u32] into r469;\n ternary r463 r458[1u32] r15.tree.branch[26u32][1u32] into r470;\n cast r469 r470 into r471 as [u128; 2u32];\n ternary r463 true r455 into r472;\n ternary r463 r458[0u32] r467[0u32] into r473;\n ternary r463 r458[1u32] r467[1u32] into r474;\n cast r473 r474 into r475 as [u128; 2u32];\n ternary r463 r459 r468 into r476;\n and r476 1u32 into r477;\n gt r477 0u32 into r478;\n not r472 into r479;\n and r478 r479 into r480;\n cast r29 r46 r63 r80 r97 r114 r131 r148 r165 r182 r199 r216 r233 r250 r267 r284 r301 r318 r335 r352 r369 r386 r403 r420 r437 r454 r471 r15.tree.branch[27u32] r15.tree.branch[28u32] r15.tree.branch[29u32] r15.tree.branch[30u32] r15.tree.branch[31u32] into r481 as [[u128; 2u32]; 32u32];\n cast r481[27u32][0u32] r481[27u32][1u32] r475[0u32] r475[1u32] into r482 as [u128; 4u32];\n hash.keccak256.native.raw r482 into r483 as [boolean; 256u32];\n deserialize.bits.raw r483 ([boolean; 256u32]) into r484 ([u128; 2u32]);\n div r476 2u32 into r485;\n ternary r480 r475[0u32] r15.tree.branch[27u32][0u32] into r486;\n ternary r480 r475[1u32] r15.tree.branch[27u32][1u32] into r487;\n cast r486 r487 into r488 as [u128; 2u32];\n ternary r480 true r472 into r489;\n ternary r480 r475[0u32] r484[0u32] into r490;\n ternary r480 r475[1u32] r484[1u32] into r491;\n cast r490 r491 into r492 as [u128; 2u32];\n ternary r480 r476 r485 into r493;\n and r493 1u32 into r494;\n gt r494 0u32 into r495;\n not r489 into r496;\n and r495 r496 into r497;\n cast r29 r46 r63 r80 r97 r114 r131 r148 r165 r182 r199 r216 r233 r250 r267 r284 r301 r318 r335 r352 r369 r386 r403 r420 r437 r454 r471 r488 r15.tree.branch[28u32] r15.tree.branch[29u32] r15.tree.branch[30u32] r15.tree.branch[31u32] into r498 as [[u128; 2u32]; 32u32];\n cast r498[28u32][0u32] r498[28u32][1u32] r492[0u32] r492[1u32] into r499 as [u128; 4u32];\n hash.keccak256.native.raw r499 into r500 as [boolean; 256u32];\n deserialize.bits.raw r500 ([boolean; 256u32]) into r501 ([u128; 2u32]);\n div r493 2u32 into r502;\n ternary r497 r492[0u32] r15.tree.branch[28u32][0u32] into r503;\n ternary r497 r492[1u32] r15.tree.branch[28u32][1u32] into r504;\n cast r503 r504 into r505 as [u128; 2u32];\n ternary r497 true r489 into r506;\n ternary r497 r492[0u32] r501[0u32] into r507;\n ternary r497 r492[1u32] r501[1u32] into r508;\n cast r507 r508 into r509 as [u128; 2u32];\n ternary r497 r493 r502 into r510;\n and r510 1u32 into r511;\n gt r511 0u32 into r512;\n not r506 into r513;\n and r512 r513 into r514;\n cast r29 r46 r63 r80 r97 r114 r131 r148 r165 r182 r199 r216 r233 r250 r267 r284 r301 r318 r335 r352 r369 r386 r403 r420 r437 r454 r471 r488 r505 r15.tree.branch[29u32] r15.tree.branch[30u32] r15.tree.branch[31u32] into r515 as [[u128; 2u32]; 32u32];\n cast r515[29u32][0u32] r515[29u32][1u32] r509[0u32] r509[1u32] into r516 as [u128; 4u32];\n hash.keccak256.native.raw r516 into r517 as [boolean; 256u32];\n deserialize.bits.raw r517 ([boolean; 256u32]) into r518 ([u128; 2u32]);\n div r510 2u32 into r519;\n ternary r514 r509[0u32] r15.tree.branch[29u32][0u32] into r520;\n ternary r514 r509[1u32] r15.tree.branch[29u32][1u32] into r521;\n cast r520 r521 into r522 as [u128; 2u32];\n ternary r514 true r506 into r523;\n ternary r514 r509[0u32] r518[0u32] into r524;\n ternary r514 r509[1u32] r518[1u32] into r525;\n cast r524 r525 into r526 as [u128; 2u32];\n ternary r514 r510 r519 into r527;\n and r527 1u32 into r528;\n gt r528 0u32 into r529;\n not r523 into r530;\n and r529 r530 into r531;\n cast r29 r46 r63 r80 r97 r114 r131 r148 r165 r182 r199 r216 r233 r250 r267 r284 r301 r318 r335 r352 r369 r386 r403 r420 r437 r454 r471 r488 r505 r522 r15.tree.branch[30u32] r15.tree.branch[31u32] into r532 as [[u128; 2u32]; 32u32];\n cast r532[30u32][0u32] r532[30u32][1u32] r526[0u32] r526[1u32] into r533 as [u128; 4u32];\n hash.keccak256.native.raw r533 into r534 as [boolean; 256u32];\n deserialize.bits.raw r534 ([boolean; 256u32]) into r535 ([u128; 2u32]);\n div r527 2u32 into r536;\n ternary r531 r526[0u32] r15.tree.branch[30u32][0u32] into r537;\n ternary r531 r526[1u32] r15.tree.branch[30u32][1u32] into r538;\n cast r537 r538 into r539 as [u128; 2u32];\n ternary r531 true r523 into r540;\n ternary r531 r526[0u32] r535[0u32] into r541;\n ternary r531 r526[1u32] r535[1u32] into r542;\n cast r541 r542 into r543 as [u128; 2u32];\n ternary r531 r527 r536 into r544;\n and r544 1u32 into r545;\n gt r545 0u32 into r546;\n not r540 into r547;\n and r546 r547 into r548;\n div r544 2u32 into r549;\n ternary r548 r543[0u32] r15.tree.branch[31u32][0u32] into r550;\n ternary r548 r543[1u32] r15.tree.branch[31u32][1u32] into r551;\n cast r550 r551 into r552 as [u128; 2u32];\n cast r29 r46 r63 r80 r97 r114 r131 r148 r165 r182 r199 r216 r233 r250 r267 r284 r301 r318 r335 r352 r369 r386 r403 r420 r437 r454 r471 r488 r505 r522 r539 r552 into r553 as [[u128; 2u32]; 32u32];\n cast r553 r17 into r554 as Tree;\n cast 0u128 0u128 into r555 as [u128; 2u32];\n shr r554.count 0u32 into r556;\n and r556 1u32 into r557;\n is.eq r557 1u32 into r558;\n cast r554.branch[0u32][0u32] r554.branch[0u32][1u32] r555[0u32] r555[1u32] into r559 as [u128; 4u32];\n hash.keccak256.native.raw r559 into r560 as [boolean; 256u32];\n deserialize.bits.raw r560 ([boolean; 256u32]) into r561 ([u128; 2u32]);\n cast r555[0u32] r555[1u32] 0u128 0u128 into r562 as [u128; 4u32];\n hash.keccak256.native.raw r562 into r563 as [boolean; 256u32];\n deserialize.bits.raw r563 ([boolean; 256u32]) into r564 ([u128; 2u32]);\n ternary r558 r561[0u32] r564[0u32] into r565;\n ternary r558 r561[1u32] r564[1u32] into r566;\n cast r565 r566 into r567 as [u128; 2u32];\n shr r554.count 1u32 into r568;\n and r568 1u32 into r569;\n is.eq r569 1u32 into r570;\n cast r554.branch[1u32][0u32] r554.branch[1u32][1u32] r567[0u32] r567[1u32] into r571 as [u128; 4u32];\n hash.keccak256.native.raw r571 into r572 as [boolean; 256u32];\n deserialize.bits.raw r572 ([boolean; 256u32]) into r573 ([u128; 2u32]);\n cast r567[0u32] r567[1u32] 200636014418684474793900124069647889069u128 241087320001230136080519585693436229163u128 into r574 as [u128; 4u32];\n hash.keccak256.native.raw r574 into r575 as [boolean; 256u32];\n deserialize.bits.raw r575 ([boolean; 256u32]) into r576 ([u128; 2u32]);\n ternary r570 r573[0u32] r576[0u32] into r577;\n ternary r570 r573[1u32] r576[1u32] into r578;\n cast r577 r578 into r579 as [u128; 2u32];\n shr r554.count 2u32 into r580;\n and r580 1u32 into r581;\n is.eq r581 1u32 into r582;\n cast r554.branch[2u32][0u32] r554.branch[2u32][1u32] r579[0u32] r579[1u32] into r583 as [u128; 4u32];\n hash.keccak256.native.raw r583 into r584 as [boolean; 256u32];\n deserialize.bits.raw r584 ([boolean; 256u32]) into r585 ([u128; 2u32]);\n cast r579[0u32] r579[1u32] 93974531276030024843854739648391266740u128 63871773629875849864439396521971482176u128 into r586 as [u128; 4u32];\n hash.keccak256.native.raw r586 into r587 as [boolean; 256u32];\n deserialize.bits.raw r587 ([boolean; 256u32]) into r588 ([u128; 2u32]);\n ternary r582 r585[0u32] r588[0u32] into r589;\n ternary r582 r585[1u32] r588[1u32] into r590;\n cast r589 r590 into r591 as [u128; 2u32];\n shr r554.count 3u32 into r592;\n and r592 1u32 into r593;\n is.eq r593 1u32 into r594;\n cast r554.branch[3u32][0u32] r554.branch[3u32][1u32] r591[0u32] r591[1u32] into r595 as [u128; 4u32];\n hash.keccak256.native.raw r595 into r596 as [boolean; 256u32];\n deserialize.bits.raw r596 ([boolean; 256u32]) into r597 ([u128; 2u32]);\n cast r591[0u32] r591[1u32] 66294067272630431583104841350689447201u128 177756802695730322470865725932422475556u128 into r598 as [u128; 4u32];\n hash.keccak256.native.raw r598 into r599 as [boolean; 256u32];\n deserialize.bits.raw r599 ([boolean; 256u32]) into r600 ([u128; 2u32]);\n ternary r594 r597[0u32] r600[0u32] into r601;\n ternary r594 r597[1u32] r600[1u32] into r602;\n cast r601 r602 into r603 as [u128; 2u32];\n shr r554.count 4u32 into r604;\n and r604 1u32 into r605;\n is.eq r605 1u32 into r606;\n cast r554.branch[4u32][0u32] r554.branch[4u32][1u32] r603[0u32] r603[1u32] into r607 as [u128; 4u32];\n hash.keccak256.native.raw r607 into r608 as [boolean; 256u32];\n deserialize.bits.raw r608 ([boolean; 256u32]) into r609 ([u128; 2u32]);\n cast r603[0u32] r603[1u32] 17747458619593854979588589471465572325u128 91154039873745303917061774773470934559u128 into r610 as [u128; 4u32];\n hash.keccak256.native.raw r610 into r611 as [boolean; 256u32];\n deserialize.bits.raw r611 ([boolean; 256u32]) into r612 ([u128; 2u32]);\n ternary r606 r609[0u32] r612[0u32] into r613;\n ternary r606 r609[1u32] r612[1u32] into r614;\n cast r613 r614 into r615 as [u128; 2u32];\n shr r554.count 5u32 into r616;\n and r616 1u32 into r617;\n is.eq r617 1u32 into r618;\n cast r554.branch[5u32][0u32] r554.branch[5u32][1u32] r615[0u32] r615[1u32] into r619 as [u128; 4u32];\n hash.keccak256.native.raw r619 into r620 as [boolean; 256u32];\n deserialize.bits.raw r620 ([boolean; 256u32]) into r621 ([u128; 2u32]);\n cast r615[0u32] r615[1u32] 41440521891025744745128838831940743182u128 60894629520669430433793374864326529801u128 into r622 as [u128; 4u32];\n hash.keccak256.native.raw r622 into r623 as [boolean; 256u32];\n deserialize.bits.raw r623 ([boolean; 256u32]) into r624 ([u128; 2u32]);\n ternary r618 r621[0u32] r624[0u32] into r625;\n ternary r618 r621[1u32] r624[1u32] into r626;\n cast r625 r626 into r627 as [u128; 2u32];\n shr r554.count 6u32 into r628;\n and r628 1u32 into r629;\n is.eq r629 1u32 into r630;\n cast r554.branch[6u32][0u32] r554.branch[6u32][1u32] r627[0u32] r627[1u32] into r631 as [u128; 4u32];\n hash.keccak256.native.raw r631 into r632 as [boolean; 256u32];\n deserialize.bits.raw r632 ([boolean; 256u32]) into r633 ([u128; 2u32]);\n cast r627[0u32] r627[1u32] 59903522946444936989019680377850199176u128 138372656349779401676123096700574490028u128 into r634 as [u128; 4u32];\n hash.keccak256.native.raw r634 into r635 as [boolean; 256u32];\n deserialize.bits.raw r635 ([boolean; 256u32]) into r636 ([u128; 2u32]);\n ternary r630 r633[0u32] r636[0u32] into r637;\n ternary r630 r633[1u32] r636[1u32] into r638;\n cast r637 r638 into r639 as [u128; 2u32];\n shr r554.count 7u32 into r640;\n and r640 1u32 into r641;\n is.eq r641 1u32 into r642;\n cast r554.branch[7u32][0u32] r554.branch[7u32][1u32] r639[0u32] r639[1u32] into r643 as [u128; 4u32];\n hash.keccak256.native.raw r643 into r644 as [boolean; 256u32];\n deserialize.bits.raw r644 ([boolean; 256u32]) into r645 ([u128; 2u32]);\n cast r639[0u32] r639[1u32] 3180262733561280138502805056821254143u128 174708888174609290132996609679840034611u128 into r646 as [u128; 4u32];\n hash.keccak256.native.raw r646 into r647 as [boolean; 256u32];\n deserialize.bits.raw r647 ([boolean; 256u32]) into r648 ([u128; 2u32]);\n ternary r642 r645[0u32] r648[0u32] into r649;\n ternary r642 r645[1u32] r648[1u32] into r650;\n cast r649 r650 into r651 as [u128; 2u32];\n shr r554.count 8u32 into r652;\n and r652 1u32 into r653;\n is.eq r653 1u32 into r654;\n cast r554.branch[8u32][0u32] r554.branch[8u32][1u32] r651[0u32] r651[1u32] into r655 as [u128; 4u32];\n hash.keccak256.native.raw r655 into r656 as [boolean; 256u32];\n deserialize.bits.raw r656 ([boolean; 256u32]) into r657 ([u128; 2u32]);\n cast r651[0u32] r651[1u32] 48455171203811811641967620231072081816u128 233066451124647651551022141310218850885u128 into r658 as [u128; 4u32];\n hash.keccak256.native.raw r658 into r659 as [boolean; 256u32];\n deserialize.bits.raw r659 ([boolean; 256u32]) into r660 ([u128; 2u32]);\n ternary r654 r657[0u32] r660[0u32] into r661;\n ternary r654 r657[1u32] r660[1u32] into r662;\n cast r661 r662 into r663 as [u128; 2u32];\n shr r554.count 9u32 into r664;\n and r664 1u32 into r665;\n is.eq r665 1u32 into r666;\n cast r554.branch[9u32][0u32] r554.branch[9u32][1u32] r663[0u32] r663[1u32] into r667 as [u128; 4u32];\n hash.keccak256.native.raw r667 into r668 as [boolean; 256u32];\n deserialize.bits.raw r668 ([boolean; 256u32]) into r669 ([u128; 2u32]);\n cast r663[0u32] r663[1u32] 334080689485914854275740245880500189902u128 298184847794429370937316245747346618882u128 into r670 as [u128; 4u32];\n hash.keccak256.native.raw r670 into r671 as [boolean; 256u32];\n deserialize.bits.raw r671 ([boolean; 256u32]) into r672 ([u128; 2u32]);\n ternary r666 r669[0u32] r672[0u32] into r673;\n ternary r666 r669[1u32] r672[1u32] into r674;\n cast r673 r674 into r675 as [u128; 2u32];\n shr r554.count 10u32 into r676;\n and r676 1u32 into r677;\n is.eq r677 1u32 into r678;\n cast r554.branch[10u32][0u32] r554.branch[10u32][1u32] r675[0u32] r675[1u32] into r679 as [u128; 4u32];\n hash.keccak256.native.raw r679 into r680 as [boolean; 256u32];\n deserialize.bits.raw r680 ([boolean; 256u32]) into r681 ([u128; 2u32]);\n cast r675[0u32] r675[1u32] 282653557140816677488147447345498217721u128 220339046210024952190566302967731665406u128 into r682 as [u128; 4u32];\n hash.keccak256.native.raw r682 into r683 as [boolean; 256u32];\n deserialize.bits.raw r683 ([boolean; 256u32]) into r684 ([u128; 2u32]);\n ternary r678 r681[0u32] r684[0u32] into r685;\n ternary r678 r681[1u32] r684[1u32] into r686;\n cast r685 r686 into r687 as [u128; 2u32];\n shr r554.count 11u32 into r688;\n and r688 1u32 into r689;\n is.eq r689 1u32 into r690;\n cast r554.branch[11u32][0u32] r554.branch[11u32][1u32] r687[0u32] r687[1u32] into r691 as [u128; 4u32];\n hash.keccak256.native.raw r691 into r692 as [boolean; 256u32];\n deserialize.bits.raw r692 ([boolean; 256u32]) into r693 ([u128; 2u32]);\n cast r687[0u32] r687[1u32] 145672768088204442335147548738764583416u128 195359773238112912523174698163665391889u128 into r694 as [u128; 4u32];\n hash.keccak256.native.raw r694 into r695 as [boolean; 256u32];\n deserialize.bits.raw r695 ([boolean; 256u32]) into r696 ([u128; 2u32]);\n ternary r690 r693[0u32] r696[0u32] into r697;\n ternary r690 r693[1u32] r696[1u32] into r698;\n cast r697 r698 into r699 as [u128; 2u32];\n shr r554.count 12u32 into r700;\n and r700 1u32 into r701;\n is.eq r701 1u32 into r702;\n cast r554.branch[12u32][0u32] r554.branch[12u32][1u32] r699[0u32] r699[1u32] into r703 as [u128; 4u32];\n hash.keccak256.native.raw r703 into r704 as [boolean; 256u32];\n deserialize.bits.raw r704 ([boolean; 256u32]) into r705 ([u128; 2u32]);\n cast r699[0u32] r699[1u32] 21418297075731751014499913670238572596u128 208490304233564026108050214927462029255u128 into r706 as [u128; 4u32];\n hash.keccak256.native.raw r706 into r707 as [boolean; 256u32];\n deserialize.bits.raw r707 ([boolean; 256u32]) into r708 ([u128; 2u32]);\n ternary r702 r705[0u32] r708[0u32] into r709;\n ternary r702 r705[1u32] r708[1u32] into r710;\n cast r709 r710 into r711 as [u128; 2u32];\n shr r554.count 13u32 into r712;\n and r712 1u32 into r713;\n is.eq r713 1u32 into r714;\n cast r554.branch[13u32][0u32] r554.branch[13u32][1u32] r711[0u32] r711[1u32] into r715 as [u128; 4u32];\n hash.keccak256.native.raw r715 into r716 as [boolean; 256u32];\n deserialize.bits.raw r716 ([boolean; 256u32]) into r717 ([u128; 2u32]);\n cast r711[0u32] r711[1u32] 281404733672930043025800266103516225473u128 249742050973351594617409037165098847317u128 into r718 as [u128; 4u32];\n hash.keccak256.native.raw r718 into r719 as [boolean; 256u32];\n deserialize.bits.raw r719 ([boolean; 256u32]) into r720 ([u128; 2u32]);\n ternary r714 r717[0u32] r720[0u32] into r721;\n ternary r714 r717[1u32] r720[1u32] into r722;\n cast r721 r722 into r723 as [u128; 2u32];\n shr r554.count 14u32 into r724;\n and r724 1u32 into r725;\n is.eq r725 1u32 into r726;\n cast r554.branch[14u32][0u32] r554.branch[14u32][1u32] r723[0u32] r723[1u32] into r727 as [u128; 4u32];\n hash.keccak256.native.raw r727 into r728 as [boolean; 256u32];\n deserialize.bits.raw r728 ([boolean; 256u32]) into r729 ([u128; 2u32]);\n cast r723[0u32] r723[1u32] 289879148739902069907218623618383439708u128 272153760179965878774948581978868862730u128 into r730 as [u128; 4u32];\n hash.keccak256.native.raw r730 into r731 as [boolean; 256u32];\n deserialize.bits.raw r731 ([boolean; 256u32]) into r732 ([u128; 2u32]);\n ternary r726 r729[0u32] r732[0u32] into r733;\n ternary r726 r729[1u32] r732[1u32] into r734;\n cast r733 r734 into r735 as [u128; 2u32];\n shr r554.count 15u32 into r736;\n and r736 1u32 into r737;\n is.eq r737 1u32 into r738;\n cast r554.branch[15u32][0u32] r554.branch[15u32][1u32] r735[0u32] r735[1u32] into r739 as [u128; 4u32];\n hash.keccak256.native.raw r739 into r740 as [boolean; 256u32];\n deserialize.bits.raw r740 ([boolean; 256u32]) into r741 ([u128; 2u32]);\n cast r735[0u32] r735[1u32] 293159551140992943817529578958841871322u128 279338235662809517033392482105447374970u128 into r742 as [u128; 4u32];\n hash.keccak256.native.raw r742 into r743 as [boolean; 256u32];\n deserialize.bits.raw r743 ([boolean; 256u32]) into r744 ([u128; 2u32]);\n ternary r738 r741[0u32] r744[0u32] into r745;\n ternary r738 r741[1u32] r744[1u32] into r746;\n cast r745 r746 into r747 as [u128; 2u32];\n shr r554.count 16u32 into r748;\n and r748 1u32 into r749;\n is.eq r749 1u32 into r750;\n cast r554.branch[16u32][0u32] r554.branch[16u32][1u32] r747[0u32] r747[1u32] into r751 as [u128; 4u32];\n hash.keccak256.native.raw r751 into r752 as [boolean; 256u32];\n deserialize.bits.raw r752 ([boolean; 256u32]) into r753 ([u128; 2u32]);\n cast r747[0u32] r747[1u32] 322093384055859711002317835595919209255u128 42000488150413793222910142038008516924u128 into r754 as [u128; 4u32];\n hash.keccak256.native.raw r754 into r755 as [boolean; 256u32];\n deserialize.bits.raw r755 ([boolean; 256u32]) into r756 ([u128; 2u32]);\n ternary r750 r753[0u32] r756[0u32] into r757;\n ternary r750 r753[1u32] r756[1u32] into r758;\n cast r757 r758 into r759 as [u128; 2u32];\n shr r554.count 17u32 into r760;\n and r760 1u32 into r761;\n is.eq r761 1u32 into r762;\n cast r554.branch[17u32][0u32] r554.branch[17u32][1u32] r759[0u32] r759[1u32] into r763 as [u128; 4u32];\n hash.keccak256.native.raw r763 into r764 as [boolean; 256u32];\n deserialize.bits.raw r764 ([boolean; 256u32]) into r765 ([u128; 2u32]);\n cast r759[0u32] r759[1u32] 122254499464535460357349615889605317601u128 163409875357997099341612933566874181274u128 into r766 as [u128; 4u32];\n hash.keccak256.native.raw r766 into r767 as [boolean; 256u32];\n deserialize.bits.raw r767 ([boolean; 256u32]) into r768 ([u128; 2u32]);\n ternary r762 r765[0u32] r768[0u32] into r769;\n ternary r762 r765[1u32] r768[1u32] into r770;\n cast r769 r770 into r771 as [u128; 2u32];\n shr r554.count 18u32 into r772;\n and r772 1u32 into r773;\n is.eq r773 1u32 into r774;\n cast r554.branch[18u32][0u32] r554.branch[18u32][1u32] r771[0u32] r771[1u32] into r775 as [u128; 4u32];\n hash.keccak256.native.raw r775 into r776 as [boolean; 256u32];\n deserialize.bits.raw r776 ([boolean; 256u32]) into r777 ([u128; 2u32]);\n cast r771[0u32] r771[1u32] 59132542617709958082991564676137889114u128 213307109849065044721731388145721391918u128 into r778 as [u128; 4u32];\n hash.keccak256.native.raw r778 into r779 as [boolean; 256u32];\n deserialize.bits.raw r779 ([boolean; 256u32]) into r780 ([u128; 2u32]);\n ternary r774 r777[0u32] r780[0u32] into r781;\n ternary r774 r777[1u32] r780[1u32] into r782;\n cast r781 r782 into r783 as [u128; 2u32];\n shr r554.count 19u32 into r784;\n and r784 1u32 into r785;\n is.eq r785 1u32 into r786;\n cast r554.branch[19u32][0u32] r554.branch[19u32][1u32] r783[0u32] r783[1u32] into r787 as [u128; 4u32];\n hash.keccak256.native.raw r787 into r788 as [boolean; 256u32];\n deserialize.bits.raw r788 ([boolean; 256u32]) into r789 ([u128; 2u32]);\n cast r783[0u32] r783[1u32] 81821347195604723027123097456320473780u128 213231151757453664031032733501577239314u128 into r790 as [u128; 4u32];\n hash.keccak256.native.raw r790 into r791 as [boolean; 256u32];\n deserialize.bits.raw r791 ([boolean; 256u32]) into r792 ([u128; 2u32]);\n ternary r786 r789[0u32] r792[0u32] into r793;\n ternary r786 r789[1u32] r792[1u32] into r794;\n cast r793 r794 into r795 as [u128; 2u32];\n shr r554.count 20u32 into r796;\n and r796 1u32 into r797;\n is.eq r797 1u32 into r798;\n cast r554.branch[20u32][0u32] r554.branch[20u32][1u32] r795[0u32] r795[1u32] into r799 as [u128; 4u32];\n hash.keccak256.native.raw r799 into r800 as [boolean; 256u32];\n deserialize.bits.raw r800 ([boolean; 256u32]) into r801 ([u128; 2u32]);\n cast r795[0u32] r795[1u32] 336114429845119848727407931190249152198u128 301360598096960973755532425519001651903u128 into r802 as [u128; 4u32];\n hash.keccak256.native.raw r802 into r803 as [boolean; 256u32];\n deserialize.bits.raw r803 ([boolean; 256u32]) into r804 ([u128; 2u32]);\n ternary r798 r801[0u32] r804[0u32] into r805;\n ternary r798 r801[1u32] r804[1u32] into r806;\n cast r805 r806 into r807 as [u128; 2u32];\n shr r554.count 21u32 into r808;\n and r808 1u32 into r809;\n is.eq r809 1u32 into r810;\n cast r554.branch[21u32][0u32] r554.branch[21u32][1u32] r807[0u32] r807[1u32] into r811 as [u128; 4u32];\n hash.keccak256.native.raw r811 into r812 as [boolean; 256u32];\n deserialize.bits.raw r812 ([boolean; 256u32]) into r813 ([u128; 2u32]);\n cast r807[0u32] r807[1u32] 320542506166910886628941017057425965556u128 289604304606881051317113816162407361165u128 into r814 as [u128; 4u32];\n hash.keccak256.native.raw r814 into r815 as [boolean; 256u32];\n deserialize.bits.raw r815 ([boolean; 256u32]) into r816 ([u128; 2u32]);\n ternary r810 r813[0u32] r816[0u32] into r817;\n ternary r810 r813[1u32] r816[1u32] into r818;\n cast r817 r818 into r819 as [u128; 2u32];\n shr r554.count 22u32 into r820;\n and r820 1u32 into r821;\n is.eq r821 1u32 into r822;\n cast r554.branch[22u32][0u32] r554.branch[22u32][1u32] r819[0u32] r819[1u32] into r823 as [u128; 4u32];\n hash.keccak256.native.raw r823 into r824 as [boolean; 256u32];\n deserialize.bits.raw r824 ([boolean; 256u32]) into r825 ([u128; 2u32]);\n cast r819[0u32] r819[1u32] 270315001578019215236444169667452771418u128 159359836010757059645879798671718049365u128 into r826 as [u128; 4u32];\n hash.keccak256.native.raw r826 into r827 as [boolean; 256u32];\n deserialize.bits.raw r827 ([boolean; 256u32]) into r828 ([u128; 2u32]);\n ternary r822 r825[0u32] r828[0u32] into r829;\n ternary r822 r825[1u32] r828[1u32] into r830;\n cast r829 r830 into r831 as [u128; 2u32];\n shr r554.count 23u32 into r832;\n and r832 1u32 into r833;\n is.eq r833 1u32 into r834;\n cast r554.branch[23u32][0u32] r554.branch[23u32][1u32] r831[0u32] r831[1u32] into r835 as [u128; 4u32];\n hash.keccak256.native.raw r835 into r836 as [boolean; 256u32];\n deserialize.bits.raw r836 ([boolean; 256u32]) into r837 ([u128; 2u32]);\n cast r831[0u32] r831[1u32] 222279943939488608983982977534856788045u128 110191212380795297761298100413926971842u128 into r838 as [u128; 4u32];\n hash.keccak256.native.raw r838 into r839 as [boolean; 256u32];\n deserialize.bits.raw r839 ([boolean; 256u32]) into r840 ([u128; 2u32]);\n ternary r834 r837[0u32] r840[0u32] into r841;\n ternary r834 r837[1u32] r840[1u32] into r842;\n cast r841 r842 into r843 as [u128; 2u32];\n shr r554.count 24u32 into r844;\n and r844 1u32 into r845;\n is.eq r845 1u32 into r846;\n cast r554.branch[24u32][0u32] r554.branch[24u32][1u32] r843[0u32] r843[1u32] into r847 as [u128; 4u32];\n hash.keccak256.native.raw r847 into r848 as [boolean; 256u32];\n deserialize.bits.raw r848 ([boolean; 256u32]) into r849 ([u128; 2u32]);\n cast r843[0u32] r843[1u32] 133196525511722763539122868050171643853u128 317818349342580659794271157815744496524u128 into r850 as [u128; 4u32];\n hash.keccak256.native.raw r850 into r851 as [boolean; 256u32];\n deserialize.bits.raw r851 ([boolean; 256u32]) into r852 ([u128; 2u32]);\n ternary r846 r849[0u32] r852[0u32] into r853;\n ternary r846 r849[1u32] r852[1u32] into r854;\n cast r853 r854 into r855 as [u128; 2u32];\n shr r554.count 25u32 into r856;\n and r856 1u32 into r857;\n is.eq r857 1u32 into r858;\n cast r554.branch[25u32][0u32] r554.branch[25u32][1u32] r855[0u32] r855[1u32] into r859 as [u128; 4u32];\n hash.keccak256.native.raw r859 into r860 as [boolean; 256u32];\n deserialize.bits.raw r860 ([boolean; 256u32]) into r861 ([u128; 2u32]);\n cast r855[0u32] r855[1u32] 155004929552231825612177418997554921226u128 187928388822560161625857840976354543861u128 into r862 as [u128; 4u32];\n hash.keccak256.native.raw r862 into r863 as [boolean; 256u32];\n deserialize.bits.raw r863 ([boolean; 256u32]) into r864 ([u128; 2u32]);\n ternary r858 r861[0u32] r864[0u32] into r865;\n ternary r858 r861[1u32] r864[1u32] into r866;\n cast r865 r866 into r867 as [u128; 2u32];\n shr r554.count 26u32 into r868;\n and r868 1u32 into r869;\n is.eq r869 1u32 into r870;\n cast r554.branch[26u32][0u32] r554.branch[26u32][1u32] r867[0u32] r867[1u32] into r871 as [u128; 4u32];\n hash.keccak256.native.raw r871 into r872 as [boolean; 256u32];\n deserialize.bits.raw r872 ([boolean; 256u32]) into r873 ([u128; 2u32]);\n cast r867[0u32] r867[1u32] 133005247855215888074055167590444355000u128 277185228623223348062409148812927309868u128 into r874 as [u128; 4u32];\n hash.keccak256.native.raw r874 into r875 as [boolean; 256u32];\n deserialize.bits.raw r875 ([boolean; 256u32]) into r876 ([u128; 2u32]);\n ternary r870 r873[0u32] r876[0u32] into r877;\n ternary r870 r873[1u32] r876[1u32] into r878;\n cast r877 r878 into r879 as [u128; 2u32];\n shr r554.count 27u32 into r880;\n and r880 1u32 into r881;\n is.eq r881 1u32 into r882;\n cast r554.branch[27u32][0u32] r554.branch[27u32][1u32] r879[0u32] r879[1u32] into r883 as [u128; 4u32];\n hash.keccak256.native.raw r883 into r884 as [boolean; 256u32];\n deserialize.bits.raw r884 ([boolean; 256u32]) into r885 ([u128; 2u32]);\n cast r879[0u32] r879[1u32] 297025694464961376815096585744545123459u128 40897156374938635533147054173498873588u128 into r886 as [u128; 4u32];\n hash.keccak256.native.raw r886 into r887 as [boolean; 256u32];\n deserialize.bits.raw r887 ([boolean; 256u32]) into r888 ([u128; 2u32]);\n ternary r882 r885[0u32] r888[0u32] into r889;\n ternary r882 r885[1u32] r888[1u32] into r890;\n cast r889 r890 into r891 as [u128; 2u32];\n shr r554.count 28u32 into r892;\n and r892 1u32 into r893;\n is.eq r893 1u32 into r894;\n cast r554.branch[28u32][0u32] r554.branch[28u32][1u32] r891[0u32] r891[1u32] into r895 as [u128; 4u32];\n hash.keccak256.native.raw r895 into r896 as [boolean; 256u32];\n deserialize.bits.raw r896 ([boolean; 256u32]) into r897 ([u128; 2u32]);\n cast r891[0u32] r891[1u32] 6336040213458809633392154838101667430u128 62367222880804479430297662353502398838u128 into r898 as [u128; 4u32];\n hash.keccak256.native.raw r898 into r899 as [boolean; 256u32];\n deserialize.bits.raw r899 ([boolean; 256u32]) into r900 ([u128; 2u32]);\n ternary r894 r897[0u32] r900[0u32] into r901;\n ternary r894 r897[1u32] r900[1u32] into r902;\n cast r901 r902 into r903 as [u128; 2u32];\n shr r554.count 29u32 into r904;\n and r904 1u32 into r905;\n is.eq r905 1u32 into r906;\n cast r554.branch[29u32][0u32] r554.branch[29u32][1u32] r903[0u32] r903[1u32] into r907 as [u128; 4u32];\n hash.keccak256.native.raw r907 into r908 as [boolean; 256u32];\n deserialize.bits.raw r908 ([boolean; 256u32]) into r909 ([u128; 2u32]);\n cast r903[0u32] r903[1u32] 202117996738898010692652600915964103224u128 46042986625269866222220954975551057138u128 into r910 as [u128; 4u32];\n hash.keccak256.native.raw r910 into r911 as [boolean; 256u32];\n deserialize.bits.raw r911 ([boolean; 256u32]) into r912 ([u128; 2u32]);\n ternary r906 r909[0u32] r912[0u32] into r913;\n ternary r906 r909[1u32] r912[1u32] into r914;\n cast r913 r914 into r915 as [u128; 2u32];\n shr r554.count 30u32 into r916;\n and r916 1u32 into r917;\n is.eq r917 1u32 into r918;\n cast r554.branch[30u32][0u32] r554.branch[30u32][1u32] r915[0u32] r915[1u32] into r919 as [u128; 4u32];\n hash.keccak256.native.raw r919 into r920 as [boolean; 256u32];\n deserialize.bits.raw r920 ([boolean; 256u32]) into r921 ([u128; 2u32]);\n cast r915[0u32] r915[1u32] 85413120008009180910770793363078390675u128 71567477878241302074513460496530530059u128 into r922 as [u128; 4u32];\n hash.keccak256.native.raw r922 into r923 as [boolean; 256u32];\n deserialize.bits.raw r923 ([boolean; 256u32]) into r924 ([u128; 2u32]);\n ternary r918 r921[0u32] r924[0u32] into r925;\n ternary r918 r921[1u32] r924[1u32] into r926;\n cast r925 r926 into r927 as [u128; 2u32];\n shr r554.count 31u32 into r928;\n and r928 1u32 into r929;\n is.eq r929 1u32 into r930;\n cast r554.branch[31u32][0u32] r554.branch[31u32][1u32] r927[0u32] r927[1u32] into r931 as [u128; 4u32];\n hash.keccak256.native.raw r931 into r932 as [boolean; 256u32];\n deserialize.bits.raw r932 ([boolean; 256u32]) into r933 ([u128; 2u32]);\n cast r927[0u32] r927[1u32] 297864792032486788802704391190316402820u128 225086078672275754295496924647458870974u128 into r934 as [u128; 4u32];\n hash.keccak256.native.raw r934 into r935 as [boolean; 256u32];\n deserialize.bits.raw r935 ([boolean; 256u32]) into r936 ([u128; 2u32]);\n ternary r930 r933[0u32] r936[0u32] into r937;\n ternary r930 r933[1u32] r936[1u32] into r938;\n cast r937 r938 into r939 as [u128; 2u32];\n cast r15.parent r939 r554 r15.nonce into r940 as MerkleTreeHook;\n set r940 into merkle_tree_hooks[r0];\n assert.eq r3 0u64;\n cast r0 r15.tree.count into r941 as HookIndexKey;\n cast r12 r15.tree.count into r942 as InsertedIntoTreeEvent;\n set r942 into inserted_into_tree_events[r941];\n set r15.tree.count into last_event_index[r13];\n branch.eq true true to end_otherwise_0_3;\n position end_then_0_2;\n is.eq r6 4u8 into r943;\n branch.eq r943 false to end_then_1_4;\n get igps[r0] into r944;\n cast r0 r10.destination_domain into r945 as GasConfigKey;\n cast 0u128 0u128 0u128 into r946 as DomainGasConfig;\n get.or_use destination_gas_configs[r945] r946 into r947;\n is.eq r1.gas_limit 0u128 into r948;\n ternary r948 50000u128 r1.gas_limit into r949;\n add r949 r947.gas_overhead into r950;\n mul r950 r947.gas_price into r951;\n mul r951 r947.exchange_rate into r952;\n div r952 10000000000u128 into r953;\n lte r953 18446744073709551615u128 into r954;\n assert.eq r954 true;\n cast r953 into r955 as u64;\n assert.eq r955 r3;\n cast r0 r944.count into r956 as HookIndexKey;\n cast r12 r10.destination_domain r950 r955 r944.count into r957 as GasPaymentEvent;\n set r957 into gas_payment_events[r956];\n set r944.count into last_event_index[r13];\n add r944.balance r3 into r958;\n add r944.count 1u32 into r959;\n cast r944.hook_owner r944.nonce r958 r959 into r960 as InterchainGasPaymaster;\n set r960 into igps[r0];\n branch.eq true true to end_otherwise_1_5;\n position end_then_1_4;\n is.eq r6 0u8 into r961;\n branch.eq r961 false to end_then_2_6;\n assert.eq r3 0u64;\n branch.eq true true to end_otherwise_2_7;\n position end_then_2_6;\n assert.eq false true;\n position end_otherwise_2_7;\n position end_otherwise_1_5;\n position end_otherwise_0_3;\n\nconstructor:\n assert.eq edition 0u16;\n`;
15
+ const hyp_collateral = `import credits.aleo;\nimport ism_manager.aleo;\nimport mailbox.aleo;\nimport hook_manager.aleo;\nimport dispatch_proxy.aleo;\nimport token_registry.aleo;\nprogram hyp_collateral.aleo;\n\nstruct RemoteRouter:\n domain as u32;\n recipient as [u8; 32u32];\n gas as u128;\n\nstruct Metadata:\n token_type as u8;\n token_owner as address;\n ism as address;\n hook as address;\n token_id as field;\n local_decimals as u8;\n remote_decimals as u8;\n\nstruct Message:\n version as u8;\n nonce as u32;\n origin_domain as u32;\n sender as [u8; 32u32];\n destination_domain as u32;\n recipient as [u8; 32u32];\n body as [u128; 16u32];\n\nstruct EthAddress:\n bytes as [u8; 20u32];\n\nstruct Mailbox:\n local_domain as u32;\n nonce as u32;\n process_count as u32;\n default_ism as address;\n default_hook as address;\n required_hook as address;\n dispatch_proxy as address;\n mailbox_owner as address;\n\nstruct CreditAllowance:\n spender as address;\n amount as u64;\n\nstruct HookMetadata:\n gas_limit as u128;\n extra_data as [u8; 64u32];\n\nstruct Tree:\n branch as [[u128; 2u32]; 32u32];\n count as u32;\n\nstruct DomainGasConfig:\n gas_overhead as u128;\n exchange_rate as u128;\n gas_price as u128;\n\nstruct MailboxState:\n default_hook as address;\n required_hook as address;\n\nstruct TokenMetadata:\n token_id as field;\n name as u128;\n symbol as u128;\n decimals as u8;\n supply as u128;\n max_supply as u128;\n admin as address;\n external_authorization_required as boolean;\n external_authorization_party as address;\n\nstruct TokenOwner:\n account as address;\n token_id as field;\n\nmapping remote_routers:\n key as u32.public;\n value as RemoteRouter.public;\n\nmapping remote_router_iter:\n key as u32.public;\n value as u32.public;\n\nmapping remote_router_length:\n key as boolean.public;\n value as u32.public;\n\nmapping app_metadata:\n key as boolean.public;\n value as Metadata.public;\n\nfunction init:\n input r0 as [u8; 128u32].public;\n input r1 as field.public;\n input r2 as u8.public;\n call mailbox.aleo/register_application r0 into r3;\n async init r1 r2 self.caller r3 into r4;\n output r4 as hyp_collateral.aleo/init.future;\n\nfinalize init:\n input r0 as field.public;\n input r1 as u8.public;\n input r2 as address.public;\n input r3 as mailbox.aleo/register_application.future;\n get token_registry.aleo/registered_tokens[r0] into r4;\n cast r1 into r5 as i16;\n cast r4.decimals into r6 as i16;\n sub r5 r6 into r7;\n abs r7 into r8;\n lte r8 18i16 into r9;\n assert.eq r9 true;\n contains app_metadata[true] into r10;\n assert.eq r10 false;\n cast 2u8 r2 aleo1qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq3ljyzc aleo1qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq3ljyzc r0 r4.decimals r1 into r11 as Metadata;\n set r11 into app_metadata[true];\n await r3;\n\nfunction get_address:\n output hyp_collateral.aleo as address.private;\n\nfunction set_custom_hook:\n input r0 as address.private;\n async set_custom_hook self.caller r0 into r1;\n output r1 as hyp_collateral.aleo/set_custom_hook.future;\n\nfinalize set_custom_hook:\n input r0 as address.public;\n input r1 as address.public;\n get app_metadata[true] into r2;\n assert.eq r2.token_owner r0;\n cast r2.token_type r2.token_owner r2.ism r1 r2.token_id r2.local_decimals r2.remote_decimals into r3 as Metadata;\n set r3 into app_metadata[true];\n\nfunction set_custom_ism:\n input r0 as address.private;\n async set_custom_ism self.caller r0 into r1;\n output r1 as hyp_collateral.aleo/set_custom_ism.future;\n\nfinalize set_custom_ism:\n input r0 as address.public;\n input r1 as address.public;\n get app_metadata[true] into r2;\n assert.eq r2.token_owner r0;\n cast r2.token_type r2.token_owner r1 r2.hook r2.token_id r2.local_decimals r2.remote_decimals into r3 as Metadata;\n set r3 into app_metadata[true];\n\nfunction set_owner:\n input r0 as address.private;\n async set_owner self.caller r0 into r1;\n output r1 as hyp_collateral.aleo/set_owner.future;\n\nfinalize set_owner:\n input r0 as address.public;\n input r1 as address.public;\n get app_metadata[true] into r2;\n assert.eq r2.token_owner r0;\n cast r2.token_type r1 r2.ism r2.hook r2.token_id r2.local_decimals r2.remote_decimals into r3 as Metadata;\n set r3 into app_metadata[true];\n\nfunction enroll_remote_router:\n input r0 as u32.private;\n input r1 as [u8; 32u32].private;\n input r2 as u128.private;\n async enroll_remote_router self.caller r0 r1 r2 into r3;\n output r3 as hyp_collateral.aleo/enroll_remote_router.future;\n\nfinalize enroll_remote_router:\n input r0 as address.public;\n input r1 as u32.public;\n input r2 as [u8; 32u32].public;\n input r3 as u128.public;\n get app_metadata[true] into r4;\n assert.eq r4.token_owner r0;\n contains remote_routers[r1] into r5;\n not r5 into r6;\n branch.eq r6 false to end_then_0_0;\n get.or_use remote_router_length[true] 0u32 into r7;\n set r1 into remote_router_iter[r7];\n add r7 1u32 into r8;\n set r8 into remote_router_length[true];\n branch.eq true true to end_otherwise_0_1;\n position end_then_0_0;\n position end_otherwise_0_1;\n cast r1 r2 r3 into r9 as RemoteRouter;\n set r9 into remote_routers[r1];\n\nfunction unroll_remote_router:\n input r0 as u32.private;\n async unroll_remote_router self.caller r0 into r1;\n output r1 as hyp_collateral.aleo/unroll_remote_router.future;\n\nfinalize unroll_remote_router:\n input r0 as address.public;\n input r1 as u32.public;\n get app_metadata[true] into r2;\n assert.eq r2.token_owner r0;\n remove remote_routers[r1];\n\nfunction transfer_remote:\n input r0 as Metadata.public;\n input r1 as MailboxState.public;\n input r2 as RemoteRouter.public;\n input r3 as u32.public;\n input r4 as [u128; 2u32].public;\n input r5 as u128.public;\n input r6 as [CreditAllowance; 4u32].public;\n cast 0u8 0u8 0u8 0u8 0u8 0u8 0u8 0u8 0u8 0u8 0u8 0u8 0u8 0u8 0u8 0u8 0u8 0u8 0u8 0u8 0u8 0u8 0u8 0u8 0u8 0u8 0u8 0u8 0u8 0u8 0u8 0u8 0u8 0u8 0u8 0u8 0u8 0u8 0u8 0u8 0u8 0u8 0u8 0u8 0u8 0u8 0u8 0u8 0u8 0u8 0u8 0u8 0u8 0u8 0u8 0u8 0u8 0u8 0u8 0u8 0u8 0u8 0u8 0u8 into r7 as [u8; 64u32];\n cast r2.gas r7 into r8 as HookMetadata;\n is.eq r0.local_decimals r0.remote_decimals into r9;\n shr r5 0u8 into r10;\n rem r10 256u128 into r11;\n shl r11 120u8 into r12;\n add 0u128 r12 into r13;\n shr r5 8u8 into r14;\n rem r14 256u128 into r15;\n shl r15 112u8 into r16;\n add r13 r16 into r17;\n shr r5 16u8 into r18;\n rem r18 256u128 into r19;\n shl r19 104u8 into r20;\n add r17 r20 into r21;\n shr r5 24u8 into r22;\n rem r22 256u128 into r23;\n shl r23 96u8 into r24;\n add r21 r24 into r25;\n shr r5 32u8 into r26;\n rem r26 256u128 into r27;\n shl r27 88u8 into r28;\n add r25 r28 into r29;\n shr r5 40u8 into r30;\n rem r30 256u128 into r31;\n shl r31 80u8 into r32;\n add r29 r32 into r33;\n shr r5 48u8 into r34;\n rem r34 256u128 into r35;\n shl r35 72u8 into r36;\n add r33 r36 into r37;\n shr r5 56u8 into r38;\n rem r38 256u128 into r39;\n shl r39 64u8 into r40;\n add r37 r40 into r41;\n shr r5 64u8 into r42;\n rem r42 256u128 into r43;\n shl r43 56u8 into r44;\n add r41 r44 into r45;\n shr r5 72u8 into r46;\n rem r46 256u128 into r47;\n shl r47 48u8 into r48;\n add r45 r48 into r49;\n shr r5 80u8 into r50;\n rem r50 256u128 into r51;\n shl r51 40u8 into r52;\n add r49 r52 into r53;\n shr r5 88u8 into r54;\n rem r54 256u128 into r55;\n shl r55 32u8 into r56;\n add r53 r56 into r57;\n shr r5 96u8 into r58;\n rem r58 256u128 into r59;\n shl r59 24u8 into r60;\n add r57 r60 into r61;\n shr r5 104u8 into r62;\n rem r62 256u128 into r63;\n shl r63 16u8 into r64;\n add r61 r64 into r65;\n shr r5 112u8 into r66;\n rem r66 256u128 into r67;\n shl r67 8u8 into r68;\n add r65 r68 into r69;\n shr r5 120u8 into r70;\n rem r70 256u128 into r71;\n shl r71 0u8 into r72;\n add r69 r72 into r73;\n cast 0u128 r73 into r74 as [u128; 2u32];\n lt r0.remote_decimals r0.local_decimals into r75;\n lt r0.local_decimals r0.remote_decimals into r76;\n ternary r76 r0.remote_decimals r0.local_decimals into r77;\n sub r77 r0.remote_decimals into r78;\n pow 10u128 r78 into r79;\n div r5 r79 into r80;\n shr r80 0u8 into r81;\n rem r81 256u128 into r82;\n shl r82 120u8 into r83;\n add 0u128 r83 into r84;\n shr r80 8u8 into r85;\n rem r85 256u128 into r86;\n shl r86 112u8 into r87;\n add r84 r87 into r88;\n shr r80 16u8 into r89;\n rem r89 256u128 into r90;\n shl r90 104u8 into r91;\n add r88 r91 into r92;\n shr r80 24u8 into r93;\n rem r93 256u128 into r94;\n shl r94 96u8 into r95;\n add r92 r95 into r96;\n shr r80 32u8 into r97;\n rem r97 256u128 into r98;\n shl r98 88u8 into r99;\n add r96 r99 into r100;\n shr r80 40u8 into r101;\n rem r101 256u128 into r102;\n shl r102 80u8 into r103;\n add r100 r103 into r104;\n shr r80 48u8 into r105;\n rem r105 256u128 into r106;\n shl r106 72u8 into r107;\n add r104 r107 into r108;\n shr r80 56u8 into r109;\n rem r109 256u128 into r110;\n shl r110 64u8 into r111;\n add r108 r111 into r112;\n shr r80 64u8 into r113;\n rem r113 256u128 into r114;\n shl r114 56u8 into r115;\n add r112 r115 into r116;\n shr r80 72u8 into r117;\n rem r117 256u128 into r118;\n shl r118 48u8 into r119;\n add r116 r119 into r120;\n shr r80 80u8 into r121;\n rem r121 256u128 into r122;\n shl r122 40u8 into r123;\n add r120 r123 into r124;\n shr r80 88u8 into r125;\n rem r125 256u128 into r126;\n shl r126 32u8 into r127;\n add r124 r127 into r128;\n shr r80 96u8 into r129;\n rem r129 256u128 into r130;\n shl r130 24u8 into r131;\n add r128 r131 into r132;\n shr r80 104u8 into r133;\n rem r133 256u128 into r134;\n shl r134 16u8 into r135;\n add r132 r135 into r136;\n shr r80 112u8 into r137;\n rem r137 256u128 into r138;\n shl r138 8u8 into r139;\n add r136 r139 into r140;\n shr r80 120u8 into r141;\n rem r141 256u128 into r142;\n shl r142 0u8 into r143;\n add r140 r143 into r144;\n cast 0u128 r144 into r145 as [u128; 2u32];\n not r75 into r146;\n gt r0.local_decimals r0.remote_decimals into r147;\n ternary r147 r0.remote_decimals r0.local_decimals into r148;\n cast 0u64 0u64 0u64 0u64 into r149 as [u64; 4u32];\n shr r5 64u32 into r150;\n cast r150 into r151 as u64;\n and r5 18446744073709551615u128 into r152;\n cast r152 into r153 as u64;\n sub r0.remote_decimals r148 into r154;\n pow 10u64 r154 into r155;\n cast r153 into r156 as u128;\n cast r155 into r157 as u128;\n mul r156 r157 into r158;\n add r158 0u128 into r159;\n and r159 18446744073709551615u128 into r160;\n cast r160 into r161 as u64;\n shr r159 64u32 into r162;\n cast r151 into r163 as u128;\n cast r155 into r164 as u128;\n mul r163 r164 into r165;\n add r165 r162 into r166;\n and r166 18446744073709551615u128 into r167;\n cast r167 into r168 as u64;\n shr r166 64u32 into r169;\n cast r149[1u32] into r170 as u128;\n cast r155 into r171 as u128;\n mul r170 r171 into r172;\n add r172 r169 into r173;\n and r173 18446744073709551615u128 into r174;\n cast r174 into r175 as u64;\n shr r173 64u32 into r176;\n cast r149[0u32] into r177 as u128;\n cast r155 into r178 as u128;\n mul r177 r178 into r179;\n add r179 r176 into r180;\n and r180 18446744073709551615u128 into r181;\n cast r181 into r182 as u64;\n shr r180 64u32 into r183;\n not r146 into r184;\n or r9 r75 into r185;\n is.eq r183 0u128 into r186;\n or r186 r184 into r187;\n or r187 r185 into r188;\n assert.eq r188 true;\n cast r182 into r189 as u128;\n shl r189 64u32 into r190;\n cast r175 into r191 as u128;\n add r190 r191 into r192;\n cast r168 into r193 as u128;\n shl r193 64u32 into r194;\n cast r161 into r195 as u128;\n add r194 r195 into r196;\n shr r192 0u8 into r197;\n rem r197 256u128 into r198;\n shl r198 120u8 into r199;\n add 0u128 r199 into r200;\n shr r192 8u8 into r201;\n rem r201 256u128 into r202;\n shl r202 112u8 into r203;\n add r200 r203 into r204;\n shr r192 16u8 into r205;\n rem r205 256u128 into r206;\n shl r206 104u8 into r207;\n add r204 r207 into r208;\n shr r192 24u8 into r209;\n rem r209 256u128 into r210;\n shl r210 96u8 into r211;\n add r208 r211 into r212;\n shr r192 32u8 into r213;\n rem r213 256u128 into r214;\n shl r214 88u8 into r215;\n add r212 r215 into r216;\n shr r192 40u8 into r217;\n rem r217 256u128 into r218;\n shl r218 80u8 into r219;\n add r216 r219 into r220;\n shr r192 48u8 into r221;\n rem r221 256u128 into r222;\n shl r222 72u8 into r223;\n add r220 r223 into r224;\n shr r192 56u8 into r225;\n rem r225 256u128 into r226;\n shl r226 64u8 into r227;\n add r224 r227 into r228;\n shr r192 64u8 into r229;\n rem r229 256u128 into r230;\n shl r230 56u8 into r231;\n add r228 r231 into r232;\n shr r192 72u8 into r233;\n rem r233 256u128 into r234;\n shl r234 48u8 into r235;\n add r232 r235 into r236;\n shr r192 80u8 into r237;\n rem r237 256u128 into r238;\n shl r238 40u8 into r239;\n add r236 r239 into r240;\n shr r192 88u8 into r241;\n rem r241 256u128 into r242;\n shl r242 32u8 into r243;\n add r240 r243 into r244;\n shr r192 96u8 into r245;\n rem r245 256u128 into r246;\n shl r246 24u8 into r247;\n add r244 r247 into r248;\n shr r192 104u8 into r249;\n rem r249 256u128 into r250;\n shl r250 16u8 into r251;\n add r248 r251 into r252;\n shr r192 112u8 into r253;\n rem r253 256u128 into r254;\n shl r254 8u8 into r255;\n add r252 r255 into r256;\n shr r192 120u8 into r257;\n rem r257 256u128 into r258;\n shl r258 0u8 into r259;\n add r256 r259 into r260;\n shr r196 0u8 into r261;\n rem r261 256u128 into r262;\n shl r262 120u8 into r263;\n add 0u128 r263 into r264;\n shr r196 8u8 into r265;\n rem r265 256u128 into r266;\n shl r266 112u8 into r267;\n add r264 r267 into r268;\n shr r196 16u8 into r269;\n rem r269 256u128 into r270;\n shl r270 104u8 into r271;\n add r268 r271 into r272;\n shr r196 24u8 into r273;\n rem r273 256u128 into r274;\n shl r274 96u8 into r275;\n add r272 r275 into r276;\n shr r196 32u8 into r277;\n rem r277 256u128 into r278;\n shl r278 88u8 into r279;\n add r276 r279 into r280;\n shr r196 40u8 into r281;\n rem r281 256u128 into r282;\n shl r282 80u8 into r283;\n add r280 r283 into r284;\n shr r196 48u8 into r285;\n rem r285 256u128 into r286;\n shl r286 72u8 into r287;\n add r284 r287 into r288;\n shr r196 56u8 into r289;\n rem r289 256u128 into r290;\n shl r290 64u8 into r291;\n add r288 r291 into r292;\n shr r196 64u8 into r293;\n rem r293 256u128 into r294;\n shl r294 56u8 into r295;\n add r292 r295 into r296;\n shr r196 72u8 into r297;\n rem r297 256u128 into r298;\n shl r298 48u8 into r299;\n add r296 r299 into r300;\n shr r196 80u8 into r301;\n rem r301 256u128 into r302;\n shl r302 40u8 into r303;\n add r300 r303 into r304;\n shr r196 88u8 into r305;\n rem r305 256u128 into r306;\n shl r306 32u8 into r307;\n add r304 r307 into r308;\n shr r196 96u8 into r309;\n rem r309 256u128 into r310;\n shl r310 24u8 into r311;\n add r308 r311 into r312;\n shr r196 104u8 into r313;\n rem r313 256u128 into r314;\n shl r314 16u8 into r315;\n add r312 r315 into r316;\n shr r196 112u8 into r317;\n rem r317 256u128 into r318;\n shl r318 8u8 into r319;\n add r316 r319 into r320;\n shr r196 120u8 into r321;\n rem r321 256u128 into r322;\n shl r322 0u8 into r323;\n add r320 r323 into r324;\n cast r260 r324 into r325 as [u128; 2u32];\n ternary r75 r145[0u32] r325[0u32] into r326;\n ternary r75 r145[1u32] r325[1u32] into r327;\n cast r326 r327 into r328 as [u128; 2u32];\n ternary r9 r74[0u32] r328[0u32] into r329;\n ternary r9 r74[1u32] r328[1u32] into r330;\n cast r329 r330 into r331 as [u128; 2u32];\n cast 0u128 0u128 0u128 0u128 0u128 0u128 0u128 0u128 0u128 0u128 0u128 0u128 0u128 0u128 0u128 0u128 into r332 as [u128; 16u32];\n cast r4[0u32] r4[1u32] r331[0u32] r331[1u32] r332[4u32] r332[5u32] r332[6u32] r332[7u32] r332[8u32] r332[9u32] r332[10u32] r332[11u32] r332[12u32] r332[13u32] r332[14u32] r332[15u32] into r333 as [u128; 16u32];\n call dispatch_proxy.aleo/dispatch r1 r3 r2.recipient r333 r0.hook r8 r6 into r334;\n call token_registry.aleo/transfer_public_as_signer r0.token_id hyp_collateral.aleo r5 into r335;\n async transfer_remote r334 r335 r2 r3 r0 into r336;\n output r336 as hyp_collateral.aleo/transfer_remote.future;\n\nfinalize transfer_remote:\n input r0 as dispatch_proxy.aleo/dispatch.future;\n input r1 as token_registry.aleo/transfer_public_as_signer.future;\n input r2 as RemoteRouter.public;\n input r3 as u32.public;\n input r4 as Metadata.public;\n get remote_routers[r3] into r5;\n assert.eq r5 r2;\n get app_metadata[true] into r6;\n assert.eq r4 r6;\n await r0;\n await r1;\n\nfunction transfer_remote_with_hook:\n input r0 as Metadata.public;\n input r1 as MailboxState.public;\n input r2 as RemoteRouter.public;\n input r3 as u32.public;\n input r4 as [u128; 2u32].public;\n input r5 as u128.public;\n input r6 as [CreditAllowance; 4u32].public;\n input r7 as address.public;\n input r8 as HookMetadata.public;\n is.eq r8.gas_limit 0u128 into r9;\n ternary r9 r2.gas r8.gas_limit into r10;\n is.eq r0.local_decimals r0.remote_decimals into r11;\n shr r5 0u8 into r12;\n rem r12 256u128 into r13;\n shl r13 120u8 into r14;\n add 0u128 r14 into r15;\n shr r5 8u8 into r16;\n rem r16 256u128 into r17;\n shl r17 112u8 into r18;\n add r15 r18 into r19;\n shr r5 16u8 into r20;\n rem r20 256u128 into r21;\n shl r21 104u8 into r22;\n add r19 r22 into r23;\n shr r5 24u8 into r24;\n rem r24 256u128 into r25;\n shl r25 96u8 into r26;\n add r23 r26 into r27;\n shr r5 32u8 into r28;\n rem r28 256u128 into r29;\n shl r29 88u8 into r30;\n add r27 r30 into r31;\n shr r5 40u8 into r32;\n rem r32 256u128 into r33;\n shl r33 80u8 into r34;\n add r31 r34 into r35;\n shr r5 48u8 into r36;\n rem r36 256u128 into r37;\n shl r37 72u8 into r38;\n add r35 r38 into r39;\n shr r5 56u8 into r40;\n rem r40 256u128 into r41;\n shl r41 64u8 into r42;\n add r39 r42 into r43;\n shr r5 64u8 into r44;\n rem r44 256u128 into r45;\n shl r45 56u8 into r46;\n add r43 r46 into r47;\n shr r5 72u8 into r48;\n rem r48 256u128 into r49;\n shl r49 48u8 into r50;\n add r47 r50 into r51;\n shr r5 80u8 into r52;\n rem r52 256u128 into r53;\n shl r53 40u8 into r54;\n add r51 r54 into r55;\n shr r5 88u8 into r56;\n rem r56 256u128 into r57;\n shl r57 32u8 into r58;\n add r55 r58 into r59;\n shr r5 96u8 into r60;\n rem r60 256u128 into r61;\n shl r61 24u8 into r62;\n add r59 r62 into r63;\n shr r5 104u8 into r64;\n rem r64 256u128 into r65;\n shl r65 16u8 into r66;\n add r63 r66 into r67;\n shr r5 112u8 into r68;\n rem r68 256u128 into r69;\n shl r69 8u8 into r70;\n add r67 r70 into r71;\n shr r5 120u8 into r72;\n rem r72 256u128 into r73;\n shl r73 0u8 into r74;\n add r71 r74 into r75;\n cast 0u128 r75 into r76 as [u128; 2u32];\n lt r0.remote_decimals r0.local_decimals into r77;\n lt r0.local_decimals r0.remote_decimals into r78;\n ternary r78 r0.remote_decimals r0.local_decimals into r79;\n sub r79 r0.remote_decimals into r80;\n pow 10u128 r80 into r81;\n div r5 r81 into r82;\n shr r82 0u8 into r83;\n rem r83 256u128 into r84;\n shl r84 120u8 into r85;\n add 0u128 r85 into r86;\n shr r82 8u8 into r87;\n rem r87 256u128 into r88;\n shl r88 112u8 into r89;\n add r86 r89 into r90;\n shr r82 16u8 into r91;\n rem r91 256u128 into r92;\n shl r92 104u8 into r93;\n add r90 r93 into r94;\n shr r82 24u8 into r95;\n rem r95 256u128 into r96;\n shl r96 96u8 into r97;\n add r94 r97 into r98;\n shr r82 32u8 into r99;\n rem r99 256u128 into r100;\n shl r100 88u8 into r101;\n add r98 r101 into r102;\n shr r82 40u8 into r103;\n rem r103 256u128 into r104;\n shl r104 80u8 into r105;\n add r102 r105 into r106;\n shr r82 48u8 into r107;\n rem r107 256u128 into r108;\n shl r108 72u8 into r109;\n add r106 r109 into r110;\n shr r82 56u8 into r111;\n rem r111 256u128 into r112;\n shl r112 64u8 into r113;\n add r110 r113 into r114;\n shr r82 64u8 into r115;\n rem r115 256u128 into r116;\n shl r116 56u8 into r117;\n add r114 r117 into r118;\n shr r82 72u8 into r119;\n rem r119 256u128 into r120;\n shl r120 48u8 into r121;\n add r118 r121 into r122;\n shr r82 80u8 into r123;\n rem r123 256u128 into r124;\n shl r124 40u8 into r125;\n add r122 r125 into r126;\n shr r82 88u8 into r127;\n rem r127 256u128 into r128;\n shl r128 32u8 into r129;\n add r126 r129 into r130;\n shr r82 96u8 into r131;\n rem r131 256u128 into r132;\n shl r132 24u8 into r133;\n add r130 r133 into r134;\n shr r82 104u8 into r135;\n rem r135 256u128 into r136;\n shl r136 16u8 into r137;\n add r134 r137 into r138;\n shr r82 112u8 into r139;\n rem r139 256u128 into r140;\n shl r140 8u8 into r141;\n add r138 r141 into r142;\n shr r82 120u8 into r143;\n rem r143 256u128 into r144;\n shl r144 0u8 into r145;\n add r142 r145 into r146;\n cast 0u128 r146 into r147 as [u128; 2u32];\n not r77 into r148;\n gt r0.local_decimals r0.remote_decimals into r149;\n ternary r149 r0.remote_decimals r0.local_decimals into r150;\n cast 0u64 0u64 0u64 0u64 into r151 as [u64; 4u32];\n shr r5 64u32 into r152;\n cast r152 into r153 as u64;\n and r5 18446744073709551615u128 into r154;\n cast r154 into r155 as u64;\n sub r0.remote_decimals r150 into r156;\n pow 10u64 r156 into r157;\n cast r155 into r158 as u128;\n cast r157 into r159 as u128;\n mul r158 r159 into r160;\n add r160 0u128 into r161;\n and r161 18446744073709551615u128 into r162;\n cast r162 into r163 as u64;\n shr r161 64u32 into r164;\n cast r153 into r165 as u128;\n cast r157 into r166 as u128;\n mul r165 r166 into r167;\n add r167 r164 into r168;\n and r168 18446744073709551615u128 into r169;\n cast r169 into r170 as u64;\n shr r168 64u32 into r171;\n cast r151[1u32] into r172 as u128;\n cast r157 into r173 as u128;\n mul r172 r173 into r174;\n add r174 r171 into r175;\n and r175 18446744073709551615u128 into r176;\n cast r176 into r177 as u64;\n shr r175 64u32 into r178;\n cast r151[0u32] into r179 as u128;\n cast r157 into r180 as u128;\n mul r179 r180 into r181;\n add r181 r178 into r182;\n and r182 18446744073709551615u128 into r183;\n cast r183 into r184 as u64;\n shr r182 64u32 into r185;\n not r148 into r186;\n or r11 r77 into r187;\n is.eq r185 0u128 into r188;\n or r188 r186 into r189;\n or r189 r187 into r190;\n assert.eq r190 true;\n cast r184 into r191 as u128;\n shl r191 64u32 into r192;\n cast r177 into r193 as u128;\n add r192 r193 into r194;\n cast r170 into r195 as u128;\n shl r195 64u32 into r196;\n cast r163 into r197 as u128;\n add r196 r197 into r198;\n shr r194 0u8 into r199;\n rem r199 256u128 into r200;\n shl r200 120u8 into r201;\n add 0u128 r201 into r202;\n shr r194 8u8 into r203;\n rem r203 256u128 into r204;\n shl r204 112u8 into r205;\n add r202 r205 into r206;\n shr r194 16u8 into r207;\n rem r207 256u128 into r208;\n shl r208 104u8 into r209;\n add r206 r209 into r210;\n shr r194 24u8 into r211;\n rem r211 256u128 into r212;\n shl r212 96u8 into r213;\n add r210 r213 into r214;\n shr r194 32u8 into r215;\n rem r215 256u128 into r216;\n shl r216 88u8 into r217;\n add r214 r217 into r218;\n shr r194 40u8 into r219;\n rem r219 256u128 into r220;\n shl r220 80u8 into r221;\n add r218 r221 into r222;\n shr r194 48u8 into r223;\n rem r223 256u128 into r224;\n shl r224 72u8 into r225;\n add r222 r225 into r226;\n shr r194 56u8 into r227;\n rem r227 256u128 into r228;\n shl r228 64u8 into r229;\n add r226 r229 into r230;\n shr r194 64u8 into r231;\n rem r231 256u128 into r232;\n shl r232 56u8 into r233;\n add r230 r233 into r234;\n shr r194 72u8 into r235;\n rem r235 256u128 into r236;\n shl r236 48u8 into r237;\n add r234 r237 into r238;\n shr r194 80u8 into r239;\n rem r239 256u128 into r240;\n shl r240 40u8 into r241;\n add r238 r241 into r242;\n shr r194 88u8 into r243;\n rem r243 256u128 into r244;\n shl r244 32u8 into r245;\n add r242 r245 into r246;\n shr r194 96u8 into r247;\n rem r247 256u128 into r248;\n shl r248 24u8 into r249;\n add r246 r249 into r250;\n shr r194 104u8 into r251;\n rem r251 256u128 into r252;\n shl r252 16u8 into r253;\n add r250 r253 into r254;\n shr r194 112u8 into r255;\n rem r255 256u128 into r256;\n shl r256 8u8 into r257;\n add r254 r257 into r258;\n shr r194 120u8 into r259;\n rem r259 256u128 into r260;\n shl r260 0u8 into r261;\n add r258 r261 into r262;\n shr r198 0u8 into r263;\n rem r263 256u128 into r264;\n shl r264 120u8 into r265;\n add 0u128 r265 into r266;\n shr r198 8u8 into r267;\n rem r267 256u128 into r268;\n shl r268 112u8 into r269;\n add r266 r269 into r270;\n shr r198 16u8 into r271;\n rem r271 256u128 into r272;\n shl r272 104u8 into r273;\n add r270 r273 into r274;\n shr r198 24u8 into r275;\n rem r275 256u128 into r276;\n shl r276 96u8 into r277;\n add r274 r277 into r278;\n shr r198 32u8 into r279;\n rem r279 256u128 into r280;\n shl r280 88u8 into r281;\n add r278 r281 into r282;\n shr r198 40u8 into r283;\n rem r283 256u128 into r284;\n shl r284 80u8 into r285;\n add r282 r285 into r286;\n shr r198 48u8 into r287;\n rem r287 256u128 into r288;\n shl r288 72u8 into r289;\n add r286 r289 into r290;\n shr r198 56u8 into r291;\n rem r291 256u128 into r292;\n shl r292 64u8 into r293;\n add r290 r293 into r294;\n shr r198 64u8 into r295;\n rem r295 256u128 into r296;\n shl r296 56u8 into r297;\n add r294 r297 into r298;\n shr r198 72u8 into r299;\n rem r299 256u128 into r300;\n shl r300 48u8 into r301;\n add r298 r301 into r302;\n shr r198 80u8 into r303;\n rem r303 256u128 into r304;\n shl r304 40u8 into r305;\n add r302 r305 into r306;\n shr r198 88u8 into r307;\n rem r307 256u128 into r308;\n shl r308 32u8 into r309;\n add r306 r309 into r310;\n shr r198 96u8 into r311;\n rem r311 256u128 into r312;\n shl r312 24u8 into r313;\n add r310 r313 into r314;\n shr r198 104u8 into r315;\n rem r315 256u128 into r316;\n shl r316 16u8 into r317;\n add r314 r317 into r318;\n shr r198 112u8 into r319;\n rem r319 256u128 into r320;\n shl r320 8u8 into r321;\n add r318 r321 into r322;\n shr r198 120u8 into r323;\n rem r323 256u128 into r324;\n shl r324 0u8 into r325;\n add r322 r325 into r326;\n cast r262 r326 into r327 as [u128; 2u32];\n ternary r77 r147[0u32] r327[0u32] into r328;\n ternary r77 r147[1u32] r327[1u32] into r329;\n cast r328 r329 into r330 as [u128; 2u32];\n ternary r11 r76[0u32] r330[0u32] into r331;\n ternary r11 r76[1u32] r330[1u32] into r332;\n cast r331 r332 into r333 as [u128; 2u32];\n cast 0u128 0u128 0u128 0u128 0u128 0u128 0u128 0u128 0u128 0u128 0u128 0u128 0u128 0u128 0u128 0u128 into r334 as [u128; 16u32];\n cast r4[0u32] r4[1u32] r333[0u32] r333[1u32] r334[4u32] r334[5u32] r334[6u32] r334[7u32] r334[8u32] r334[9u32] r334[10u32] r334[11u32] r334[12u32] r334[13u32] r334[14u32] r334[15u32] into r335 as [u128; 16u32];\n cast r10 r8.extra_data into r336 as HookMetadata;\n call dispatch_proxy.aleo/dispatch r1 r3 r2.recipient r335 r7 r336 r6 into r337;\n call token_registry.aleo/transfer_public_as_signer r0.token_id hyp_collateral.aleo r5 into r338;\n async transfer_remote_with_hook r337 r338 r2 r3 r0 into r339;\n output r339 as hyp_collateral.aleo/transfer_remote_with_hook.future;\n\nfinalize transfer_remote_with_hook:\n input r0 as dispatch_proxy.aleo/dispatch.future;\n input r1 as token_registry.aleo/transfer_public_as_signer.future;\n input r2 as RemoteRouter.public;\n input r3 as u32.public;\n input r4 as Metadata.public;\n get remote_routers[r3] into r5;\n assert.eq r5 r2;\n get app_metadata[true] into r6;\n assert.eq r4 r6;\n await r0;\n await r1;\n\nfunction process:\n input r0 as address.public;\n input r1 as Metadata.public;\n input r2 as Message.public;\n input r3 as u32.public;\n input r4 as [u128; 2u32].public;\n input r5 as [u8; 512u32].public;\n call mailbox.aleo/process r0 r2 r3 r4 r5 into r6;\n cast r2.body[0u32] r2.body[1u32] into r7 as [u128; 2u32];\n serialize.bits.raw r7 ([u128; 2u32]) into r8 ([boolean; 256u32]);\n cast r8[0u32] r8[1u32] r8[2u32] r8[3u32] r8[4u32] r8[5u32] r8[6u32] r8[7u32] r8[8u32] r8[9u32] r8[10u32] r8[11u32] r8[12u32] r8[13u32] r8[14u32] r8[15u32] r8[16u32] r8[17u32] r8[18u32] r8[19u32] r8[20u32] r8[21u32] r8[22u32] r8[23u32] r8[24u32] r8[25u32] r8[26u32] r8[27u32] r8[28u32] r8[29u32] r8[30u32] r8[31u32] r8[32u32] r8[33u32] r8[34u32] r8[35u32] r8[36u32] r8[37u32] r8[38u32] r8[39u32] r8[40u32] r8[41u32] r8[42u32] r8[43u32] r8[44u32] r8[45u32] r8[46u32] r8[47u32] r8[48u32] r8[49u32] r8[50u32] r8[51u32] r8[52u32] r8[53u32] r8[54u32] r8[55u32] r8[56u32] r8[57u32] r8[58u32] r8[59u32] r8[60u32] r8[61u32] r8[62u32] r8[63u32] r8[64u32] r8[65u32] r8[66u32] r8[67u32] r8[68u32] r8[69u32] r8[70u32] r8[71u32] r8[72u32] r8[73u32] r8[74u32] r8[75u32] r8[76u32] r8[77u32] r8[78u32] r8[79u32] r8[80u32] r8[81u32] r8[82u32] r8[83u32] r8[84u32] r8[85u32] r8[86u32] r8[87u32] r8[88u32] r8[89u32] r8[90u32] r8[91u32] r8[92u32] r8[93u32] r8[94u32] r8[95u32] r8[96u32] r8[97u32] r8[98u32] r8[99u32] r8[100u32] r8[101u32] r8[102u32] r8[103u32] r8[104u32] r8[105u32] r8[106u32] r8[107u32] r8[108u32] r8[109u32] r8[110u32] r8[111u32] r8[112u32] r8[113u32] r8[114u32] r8[115u32] r8[116u32] r8[117u32] r8[118u32] r8[119u32] r8[120u32] r8[121u32] r8[122u32] r8[123u32] r8[124u32] r8[125u32] r8[126u32] r8[127u32] r8[128u32] r8[129u32] r8[130u32] r8[131u32] r8[132u32] r8[133u32] r8[134u32] r8[135u32] r8[136u32] r8[137u32] r8[138u32] r8[139u32] r8[140u32] r8[141u32] r8[142u32] r8[143u32] r8[144u32] r8[145u32] r8[146u32] r8[147u32] r8[148u32] r8[149u32] r8[150u32] r8[151u32] r8[152u32] r8[153u32] r8[154u32] r8[155u32] r8[156u32] r8[157u32] r8[158u32] r8[159u32] r8[160u32] r8[161u32] r8[162u32] r8[163u32] r8[164u32] r8[165u32] r8[166u32] r8[167u32] r8[168u32] r8[169u32] r8[170u32] r8[171u32] r8[172u32] r8[173u32] r8[174u32] r8[175u32] r8[176u32] r8[177u32] r8[178u32] r8[179u32] r8[180u32] r8[181u32] r8[182u32] r8[183u32] r8[184u32] r8[185u32] r8[186u32] r8[187u32] r8[188u32] r8[189u32] r8[190u32] r8[191u32] r8[192u32] r8[193u32] r8[194u32] r8[195u32] r8[196u32] r8[197u32] r8[198u32] r8[199u32] r8[200u32] r8[201u32] r8[202u32] r8[203u32] r8[204u32] r8[205u32] r8[206u32] r8[207u32] r8[208u32] r8[209u32] r8[210u32] r8[211u32] r8[212u32] r8[213u32] r8[214u32] r8[215u32] r8[216u32] r8[217u32] r8[218u32] r8[219u32] r8[220u32] r8[221u32] r8[222u32] r8[223u32] r8[224u32] r8[225u32] r8[226u32] r8[227u32] r8[228u32] r8[229u32] r8[230u32] r8[231u32] r8[232u32] r8[233u32] r8[234u32] r8[235u32] r8[236u32] r8[237u32] r8[238u32] r8[239u32] r8[240u32] r8[241u32] r8[242u32] r8[243u32] r8[244u32] r8[245u32] r8[246u32] r8[247u32] r8[248u32] r8[249u32] r8[250u32] r8[251u32] r8[252u32] into r9 as [boolean; 253u32];\n deserialize.bits.raw r9 ([boolean; 253u32]) into r10 (address);\n cast r2.body[2u32] r2.body[3u32] into r11 as [u128; 2u32];\n is.eq r1.local_decimals r1.remote_decimals into r12;\n shr r11[1u32] 0u8 into r13;\n rem r13 256u128 into r14;\n shl r14 120u8 into r15;\n add 0u128 r15 into r16;\n shr r11[1u32] 8u8 into r17;\n rem r17 256u128 into r18;\n shl r18 112u8 into r19;\n add r16 r19 into r20;\n shr r11[1u32] 16u8 into r21;\n rem r21 256u128 into r22;\n shl r22 104u8 into r23;\n add r20 r23 into r24;\n shr r11[1u32] 24u8 into r25;\n rem r25 256u128 into r26;\n shl r26 96u8 into r27;\n add r24 r27 into r28;\n shr r11[1u32] 32u8 into r29;\n rem r29 256u128 into r30;\n shl r30 88u8 into r31;\n add r28 r31 into r32;\n shr r11[1u32] 40u8 into r33;\n rem r33 256u128 into r34;\n shl r34 80u8 into r35;\n add r32 r35 into r36;\n shr r11[1u32] 48u8 into r37;\n rem r37 256u128 into r38;\n shl r38 72u8 into r39;\n add r36 r39 into r40;\n shr r11[1u32] 56u8 into r41;\n rem r41 256u128 into r42;\n shl r42 64u8 into r43;\n add r40 r43 into r44;\n shr r11[1u32] 64u8 into r45;\n rem r45 256u128 into r46;\n shl r46 56u8 into r47;\n add r44 r47 into r48;\n shr r11[1u32] 72u8 into r49;\n rem r49 256u128 into r50;\n shl r50 48u8 into r51;\n add r48 r51 into r52;\n shr r11[1u32] 80u8 into r53;\n rem r53 256u128 into r54;\n shl r54 40u8 into r55;\n add r52 r55 into r56;\n shr r11[1u32] 88u8 into r57;\n rem r57 256u128 into r58;\n shl r58 32u8 into r59;\n add r56 r59 into r60;\n shr r11[1u32] 96u8 into r61;\n rem r61 256u128 into r62;\n shl r62 24u8 into r63;\n add r60 r63 into r64;\n shr r11[1u32] 104u8 into r65;\n rem r65 256u128 into r66;\n shl r66 16u8 into r67;\n add r64 r67 into r68;\n shr r11[1u32] 112u8 into r69;\n rem r69 256u128 into r70;\n shl r70 8u8 into r71;\n add r68 r71 into r72;\n shr r11[1u32] 120u8 into r73;\n rem r73 256u128 into r74;\n shl r74 0u8 into r75;\n add r72 r75 into r76;\n lt r1.remote_decimals r1.local_decimals into r77;\n lt r1.local_decimals r1.remote_decimals into r78;\n ternary r78 r1.remote_decimals r1.local_decimals into r79;\n sub r79 r1.remote_decimals into r80;\n not r77 into r81;\n is.eq r11[0u32] 0u128 into r82;\n or r82 r81 into r83;\n or r83 r12 into r84;\n assert.eq r84 true;\n pow 10u64 r80 into r85;\n cast r85 into r86 as u128;\n mul r76 r86 into r87;\n gt r1.local_decimals r1.remote_decimals into r88;\n ternary r88 r1.remote_decimals r1.local_decimals into r89;\n sub r1.remote_decimals r89 into r90;\n pow 10u64 r90 into r91;\n serialize.bits.raw r11 ([u128; 2u32]) into r92 ([boolean; 256u32]);\n deserialize.bits.raw r92 ([boolean; 256u32]) into r93 ([u8; 32u32]);\n cast r93[0u32] into r94 as u64;\n shl r94 56u32 into r95;\n add 0u64 r95 into r96;\n cast r93[1u32] into r97 as u64;\n shl r97 48u32 into r98;\n add r96 r98 into r99;\n cast r93[2u32] into r100 as u64;\n shl r100 40u32 into r101;\n add r99 r101 into r102;\n cast r93[3u32] into r103 as u64;\n shl r103 32u32 into r104;\n add r102 r104 into r105;\n cast r93[4u32] into r106 as u64;\n shl r106 24u32 into r107;\n add r105 r107 into r108;\n cast r93[5u32] into r109 as u64;\n shl r109 16u32 into r110;\n add r108 r110 into r111;\n cast r93[6u32] into r112 as u64;\n shl r112 8u32 into r113;\n add r111 r113 into r114;\n cast r93[7u32] into r115 as u64;\n shl r115 0u32 into r116;\n add r114 r116 into r117;\n cast r93[8u32] into r118 as u64;\n shl r118 56u32 into r119;\n add 0u64 r119 into r120;\n cast r93[9u32] into r121 as u64;\n shl r121 48u32 into r122;\n add r120 r122 into r123;\n cast r93[10u32] into r124 as u64;\n shl r124 40u32 into r125;\n add r123 r125 into r126;\n cast r93[11u32] into r127 as u64;\n shl r127 32u32 into r128;\n add r126 r128 into r129;\n cast r93[12u32] into r130 as u64;\n shl r130 24u32 into r131;\n add r129 r131 into r132;\n cast r93[13u32] into r133 as u64;\n shl r133 16u32 into r134;\n add r132 r134 into r135;\n cast r93[14u32] into r136 as u64;\n shl r136 8u32 into r137;\n add r135 r137 into r138;\n cast r93[15u32] into r139 as u64;\n shl r139 0u32 into r140;\n add r138 r140 into r141;\n cast r93[16u32] into r142 as u64;\n shl r142 56u32 into r143;\n add 0u64 r143 into r144;\n cast r93[17u32] into r145 as u64;\n shl r145 48u32 into r146;\n add r144 r146 into r147;\n cast r93[18u32] into r148 as u64;\n shl r148 40u32 into r149;\n add r147 r149 into r150;\n cast r93[19u32] into r151 as u64;\n shl r151 32u32 into r152;\n add r150 r152 into r153;\n cast r93[20u32] into r154 as u64;\n shl r154 24u32 into r155;\n add r153 r155 into r156;\n cast r93[21u32] into r157 as u64;\n shl r157 16u32 into r158;\n add r156 r158 into r159;\n cast r93[22u32] into r160 as u64;\n shl r160 8u32 into r161;\n add r159 r161 into r162;\n cast r93[23u32] into r163 as u64;\n shl r163 0u32 into r164;\n add r162 r164 into r165;\n cast r93[24u32] into r166 as u64;\n shl r166 56u32 into r167;\n add 0u64 r167 into r168;\n cast r93[25u32] into r169 as u64;\n shl r169 48u32 into r170;\n add r168 r170 into r171;\n cast r93[26u32] into r172 as u64;\n shl r172 40u32 into r173;\n add r171 r173 into r174;\n cast r93[27u32] into r175 as u64;\n shl r175 32u32 into r176;\n add r174 r176 into r177;\n cast r93[28u32] into r178 as u64;\n shl r178 24u32 into r179;\n add r177 r179 into r180;\n cast r93[29u32] into r181 as u64;\n shl r181 16u32 into r182;\n add r180 r182 into r183;\n cast r93[30u32] into r184 as u64;\n shl r184 8u32 into r185;\n add r183 r185 into r186;\n cast r93[31u32] into r187 as u64;\n shl r187 0u32 into r188;\n add r186 r188 into r189;\n shl 0u128 64u32 into r190;\n cast r117 into r191 as u128;\n or r190 r191 into r192;\n cast r91 into r193 as u128;\n div r192 r193 into r194;\n cast r194 into r195 as u64;\n cast r91 into r196 as u128;\n rem r192 r196 into r197;\n shl r197 64u32 into r198;\n cast r141 into r199 as u128;\n or r198 r199 into r200;\n cast r91 into r201 as u128;\n div r200 r201 into r202;\n cast r202 into r203 as u64;\n cast r91 into r204 as u128;\n rem r200 r204 into r205;\n shl r205 64u32 into r206;\n cast r165 into r207 as u128;\n or r206 r207 into r208;\n cast r91 into r209 as u128;\n div r208 r209 into r210;\n cast r210 into r211 as u64;\n cast r91 into r212 as u128;\n rem r208 r212 into r213;\n shl r213 64u32 into r214;\n cast r189 into r215 as u128;\n or r214 r215 into r216;\n cast r91 into r217 as u128;\n div r216 r217 into r218;\n cast r218 into r219 as u64;\n cast r91 into r220 as u128;\n rem r216 r220 into r221;\n assert.eq r195 0u64;\n assert.eq r203 0u64;\n cast r211 into r222 as u128;\n shl r222 64u32 into r223;\n cast r219 into r224 as u128;\n or r223 r224 into r225;\n ternary r77 r87 r225 into r226;\n ternary r12 r76 r226 into r227;\n call token_registry.aleo/transfer_public r1.token_id r10 r227 into r228;\n async process r6 r1 r2 r228 r0 into r229;\n output r229 as hyp_collateral.aleo/process.future;\n\nfinalize process:\n input r0 as mailbox.aleo/process.future;\n input r1 as Metadata.public;\n input r2 as Message.public;\n input r3 as token_registry.aleo/transfer_public.future;\n input r4 as address.public;\n get app_metadata[true] into r5;\n assert.eq r5 r1;\n get mailbox.aleo/mailbox[true] into r6;\n is.eq r5.ism aleo1qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq3ljyzc into r7;\n ternary r7 r6.default_ism r5.ism into r8;\n assert.eq r8 r4;\n get remote_routers[r2.origin_domain] into r9;\n assert.eq r9.recipient r2.sender;\n await r0;\n await r3;\n\nfunction get_balance_key:\n input r0 as address.private;\n input r1 as field.private;\n cast r0 r1 into r2 as TokenOwner;\n hash.bhp256 r2 into r3 as field;\n output r3 as field.private;\n\nconstructor:\n assert.eq edition 0u16;\n`;
16
+ const hyp_native = `import credits.aleo;\nimport ism_manager.aleo;\nimport mailbox.aleo;\nimport hook_manager.aleo;\nimport dispatch_proxy.aleo;\nprogram hyp_native.aleo;\n\nstruct RemoteRouter:\n domain as u32;\n recipient as [u8; 32u32];\n gas as u128;\n\nstruct Metadata:\n token_type as u8;\n token_owner as address;\n ism as address;\n hook as address;\n scale as u8;\n\nstruct Message:\n version as u8;\n nonce as u32;\n origin_domain as u32;\n sender as [u8; 32u32];\n destination_domain as u32;\n recipient as [u8; 32u32];\n body as [u128; 16u32];\n\nstruct EthAddress:\n bytes as [u8; 20u32];\n\nstruct Mailbox:\n local_domain as u32;\n nonce as u32;\n process_count as u32;\n default_ism as address;\n default_hook as address;\n required_hook as address;\n dispatch_proxy as address;\n mailbox_owner as address;\n\nstruct CreditAllowance:\n spender as address;\n amount as u64;\n\nstruct HookMetadata:\n gas_limit as u128;\n extra_data as [u8; 64u32];\n\nstruct Tree:\n branch as [[u128; 2u32]; 32u32];\n count as u32;\n\nstruct DomainGasConfig:\n gas_overhead as u128;\n exchange_rate as u128;\n gas_price as u128;\n\nstruct MailboxState:\n default_hook as address;\n required_hook as address;\n\nmapping remote_routers:\n key as u32.public;\n value as RemoteRouter.public;\n\nmapping remote_router_iter:\n key as u32.public;\n value as u32.public;\n\nmapping remote_router_length:\n key as boolean.public;\n value as u32.public;\n\nmapping app_metadata:\n key as boolean.public;\n value as Metadata.public;\n\nfunction init:\n input r0 as [u8; 128u32].public;\n input r1 as u8.public;\n lte r1 19u8 into r2;\n assert.eq r2 true;\n call mailbox.aleo/register_application r0 into r3;\n async init self.caller r1 r3 into r4;\n output r4 as hyp_native.aleo/init.future;\n\nfinalize init:\n input r0 as address.public;\n input r1 as u8.public;\n input r2 as mailbox.aleo/register_application.future;\n contains app_metadata[true] into r3;\n assert.eq r3 false;\n cast 0u8 r0 aleo1qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq3ljyzc aleo1qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq3ljyzc r1 into r4 as Metadata;\n set r4 into app_metadata[true];\n await r2;\n\nfunction get_address:\n output hyp_native.aleo as address.private;\n\nfunction set_custom_hook:\n input r0 as address.private;\n async set_custom_hook self.caller r0 into r1;\n output r1 as hyp_native.aleo/set_custom_hook.future;\n\nfinalize set_custom_hook:\n input r0 as address.public;\n input r1 as address.public;\n get app_metadata[true] into r2;\n assert.eq r2.token_owner r0;\n cast r2.token_type r2.token_owner r2.ism r1 r2.scale into r3 as Metadata;\n set r3 into app_metadata[true];\n\nfunction set_custom_ism:\n input r0 as address.private;\n async set_custom_ism self.caller r0 into r1;\n output r1 as hyp_native.aleo/set_custom_ism.future;\n\nfinalize set_custom_ism:\n input r0 as address.public;\n input r1 as address.public;\n get app_metadata[true] into r2;\n assert.eq r2.token_owner r0;\n cast r2.token_type r2.token_owner r1 r2.hook r2.scale into r3 as Metadata;\n set r3 into app_metadata[true];\n\nfunction set_owner:\n input r0 as address.private;\n async set_owner self.caller r0 into r1;\n output r1 as hyp_native.aleo/set_owner.future;\n\nfinalize set_owner:\n input r0 as address.public;\n input r1 as address.public;\n get app_metadata[true] into r2;\n assert.eq r2.token_owner r0;\n cast r2.token_type r1 r2.ism r2.hook r2.scale into r3 as Metadata;\n set r3 into app_metadata[true];\n\nfunction enroll_remote_router:\n input r0 as u32.private;\n input r1 as [u8; 32u32].private;\n input r2 as u128.private;\n async enroll_remote_router self.caller r0 r1 r2 into r3;\n output r3 as hyp_native.aleo/enroll_remote_router.future;\n\nfinalize enroll_remote_router:\n input r0 as address.public;\n input r1 as u32.public;\n input r2 as [u8; 32u32].public;\n input r3 as u128.public;\n get app_metadata[true] into r4;\n assert.eq r4.token_owner r0;\n contains remote_routers[r1] into r5;\n not r5 into r6;\n branch.eq r6 false to end_then_0_0;\n get.or_use remote_router_length[true] 0u32 into r7;\n set r1 into remote_router_iter[r7];\n add r7 1u32 into r8;\n set r8 into remote_router_length[true];\n branch.eq true true to end_otherwise_0_1;\n position end_then_0_0;\n position end_otherwise_0_1;\n cast r1 r2 r3 into r9 as RemoteRouter;\n set r9 into remote_routers[r1];\n\nfunction unroll_remote_router:\n input r0 as u32.private;\n async unroll_remote_router self.caller r0 into r1;\n output r1 as hyp_native.aleo/unroll_remote_router.future;\n\nfinalize unroll_remote_router:\n input r0 as address.public;\n input r1 as u32.public;\n get app_metadata[true] into r2;\n assert.eq r2.token_owner r0;\n remove remote_routers[r1];\n\nfunction transfer_remote:\n input r0 as Metadata.public;\n input r1 as MailboxState.public;\n input r2 as RemoteRouter.public;\n input r3 as u32.public;\n input r4 as [u128; 2u32].public;\n input r5 as u64.public;\n input r6 as [CreditAllowance; 4u32].public;\n cast 0u8 0u8 0u8 0u8 0u8 0u8 0u8 0u8 0u8 0u8 0u8 0u8 0u8 0u8 0u8 0u8 0u8 0u8 0u8 0u8 0u8 0u8 0u8 0u8 0u8 0u8 0u8 0u8 0u8 0u8 0u8 0u8 0u8 0u8 0u8 0u8 0u8 0u8 0u8 0u8 0u8 0u8 0u8 0u8 0u8 0u8 0u8 0u8 0u8 0u8 0u8 0u8 0u8 0u8 0u8 0u8 0u8 0u8 0u8 0u8 0u8 0u8 0u8 0u8 into r7 as [u8; 64u32];\n cast r2.gas r7 into r8 as HookMetadata;\n pow 10u64 r0.scale into r9;\n cast r5 into r10 as u128;\n cast r9 into r11 as u128;\n mul r10 r11 into r12;\n shr r12 0u8 into r13;\n rem r13 256u128 into r14;\n shl r14 120u8 into r15;\n add 0u128 r15 into r16;\n shr r12 8u8 into r17;\n rem r17 256u128 into r18;\n shl r18 112u8 into r19;\n add r16 r19 into r20;\n shr r12 16u8 into r21;\n rem r21 256u128 into r22;\n shl r22 104u8 into r23;\n add r20 r23 into r24;\n shr r12 24u8 into r25;\n rem r25 256u128 into r26;\n shl r26 96u8 into r27;\n add r24 r27 into r28;\n shr r12 32u8 into r29;\n rem r29 256u128 into r30;\n shl r30 88u8 into r31;\n add r28 r31 into r32;\n shr r12 40u8 into r33;\n rem r33 256u128 into r34;\n shl r34 80u8 into r35;\n add r32 r35 into r36;\n shr r12 48u8 into r37;\n rem r37 256u128 into r38;\n shl r38 72u8 into r39;\n add r36 r39 into r40;\n shr r12 56u8 into r41;\n rem r41 256u128 into r42;\n shl r42 64u8 into r43;\n add r40 r43 into r44;\n shr r12 64u8 into r45;\n rem r45 256u128 into r46;\n shl r46 56u8 into r47;\n add r44 r47 into r48;\n shr r12 72u8 into r49;\n rem r49 256u128 into r50;\n shl r50 48u8 into r51;\n add r48 r51 into r52;\n shr r12 80u8 into r53;\n rem r53 256u128 into r54;\n shl r54 40u8 into r55;\n add r52 r55 into r56;\n shr r12 88u8 into r57;\n rem r57 256u128 into r58;\n shl r58 32u8 into r59;\n add r56 r59 into r60;\n shr r12 96u8 into r61;\n rem r61 256u128 into r62;\n shl r62 24u8 into r63;\n add r60 r63 into r64;\n shr r12 104u8 into r65;\n rem r65 256u128 into r66;\n shl r66 16u8 into r67;\n add r64 r67 into r68;\n shr r12 112u8 into r69;\n rem r69 256u128 into r70;\n shl r70 8u8 into r71;\n add r68 r71 into r72;\n shr r12 120u8 into r73;\n rem r73 256u128 into r74;\n shl r74 0u8 into r75;\n add r72 r75 into r76;\n cast 0u128 r76 into r77 as [u128; 2u32];\n cast 0u128 0u128 0u128 0u128 0u128 0u128 0u128 0u128 0u128 0u128 0u128 0u128 0u128 0u128 0u128 0u128 into r78 as [u128; 16u32];\n cast r4[0u32] r4[1u32] r77[0u32] r77[1u32] r78[4u32] r78[5u32] r78[6u32] r78[7u32] r78[8u32] r78[9u32] r78[10u32] r78[11u32] r78[12u32] r78[13u32] r78[14u32] r78[15u32] into r79 as [u128; 16u32];\n call dispatch_proxy.aleo/dispatch r1 r3 r2.recipient r79 r0.hook r8 r6 into r80;\n call credits.aleo/transfer_public_as_signer hyp_native.aleo r5 into r81;\n async transfer_remote r80 r81 r0 r2 r3 into r82;\n output r82 as hyp_native.aleo/transfer_remote.future;\n\nfinalize transfer_remote:\n input r0 as dispatch_proxy.aleo/dispatch.future;\n input r1 as credits.aleo/transfer_public_as_signer.future;\n input r2 as Metadata.public;\n input r3 as RemoteRouter.public;\n input r4 as u32.public;\n get remote_routers[r4] into r5;\n assert.eq r5 r3;\n get app_metadata[true] into r6;\n assert.eq r6 r2;\n await r0;\n await r1;\n\nfunction transfer_remote_with_hook:\n input r0 as Metadata.public;\n input r1 as MailboxState.public;\n input r2 as RemoteRouter.public;\n input r3 as u32.public;\n input r4 as [u128; 2u32].public;\n input r5 as u64.public;\n input r6 as [CreditAllowance; 4u32].public;\n input r7 as address.public;\n input r8 as HookMetadata.public;\n is.eq r8.gas_limit 0u128 into r9;\n ternary r9 r2.gas r8.gas_limit into r10;\n pow 10u64 r0.scale into r11;\n cast r5 into r12 as u128;\n cast r11 into r13 as u128;\n mul r12 r13 into r14;\n shr r14 0u8 into r15;\n rem r15 256u128 into r16;\n shl r16 120u8 into r17;\n add 0u128 r17 into r18;\n shr r14 8u8 into r19;\n rem r19 256u128 into r20;\n shl r20 112u8 into r21;\n add r18 r21 into r22;\n shr r14 16u8 into r23;\n rem r23 256u128 into r24;\n shl r24 104u8 into r25;\n add r22 r25 into r26;\n shr r14 24u8 into r27;\n rem r27 256u128 into r28;\n shl r28 96u8 into r29;\n add r26 r29 into r30;\n shr r14 32u8 into r31;\n rem r31 256u128 into r32;\n shl r32 88u8 into r33;\n add r30 r33 into r34;\n shr r14 40u8 into r35;\n rem r35 256u128 into r36;\n shl r36 80u8 into r37;\n add r34 r37 into r38;\n shr r14 48u8 into r39;\n rem r39 256u128 into r40;\n shl r40 72u8 into r41;\n add r38 r41 into r42;\n shr r14 56u8 into r43;\n rem r43 256u128 into r44;\n shl r44 64u8 into r45;\n add r42 r45 into r46;\n shr r14 64u8 into r47;\n rem r47 256u128 into r48;\n shl r48 56u8 into r49;\n add r46 r49 into r50;\n shr r14 72u8 into r51;\n rem r51 256u128 into r52;\n shl r52 48u8 into r53;\n add r50 r53 into r54;\n shr r14 80u8 into r55;\n rem r55 256u128 into r56;\n shl r56 40u8 into r57;\n add r54 r57 into r58;\n shr r14 88u8 into r59;\n rem r59 256u128 into r60;\n shl r60 32u8 into r61;\n add r58 r61 into r62;\n shr r14 96u8 into r63;\n rem r63 256u128 into r64;\n shl r64 24u8 into r65;\n add r62 r65 into r66;\n shr r14 104u8 into r67;\n rem r67 256u128 into r68;\n shl r68 16u8 into r69;\n add r66 r69 into r70;\n shr r14 112u8 into r71;\n rem r71 256u128 into r72;\n shl r72 8u8 into r73;\n add r70 r73 into r74;\n shr r14 120u8 into r75;\n rem r75 256u128 into r76;\n shl r76 0u8 into r77;\n add r74 r77 into r78;\n cast 0u128 r78 into r79 as [u128; 2u32];\n cast 0u128 0u128 0u128 0u128 0u128 0u128 0u128 0u128 0u128 0u128 0u128 0u128 0u128 0u128 0u128 0u128 into r80 as [u128; 16u32];\n cast r4[0u32] r4[1u32] r79[0u32] r79[1u32] r80[4u32] r80[5u32] r80[6u32] r80[7u32] r80[8u32] r80[9u32] r80[10u32] r80[11u32] r80[12u32] r80[13u32] r80[14u32] r80[15u32] into r81 as [u128; 16u32];\n cast r10 r8.extra_data into r82 as HookMetadata;\n call dispatch_proxy.aleo/dispatch r1 r3 r2.recipient r81 r7 r82 r6 into r83;\n call credits.aleo/transfer_public_as_signer hyp_native.aleo r5 into r84;\n async transfer_remote_with_hook r83 r84 r0 r2 r3 into r85;\n output r85 as hyp_native.aleo/transfer_remote_with_hook.future;\n\nfinalize transfer_remote_with_hook:\n input r0 as dispatch_proxy.aleo/dispatch.future;\n input r1 as credits.aleo/transfer_public_as_signer.future;\n input r2 as Metadata.public;\n input r3 as RemoteRouter.public;\n input r4 as u32.public;\n get remote_routers[r4] into r5;\n assert.eq r5 r3;\n get app_metadata[true] into r6;\n assert.eq r6 r2;\n await r0;\n await r1;\n\nfunction process:\n input r0 as address.public;\n input r1 as Metadata.public;\n input r2 as Message.public;\n input r3 as u32.public;\n input r4 as [u128; 2u32].public;\n input r5 as [u8; 512u32].public;\n cast r2.body[2u32] r2.body[3u32] into r6 as [u128; 2u32];\n pow 10u64 r1.scale into r7;\n serialize.bits.raw r6 ([u128; 2u32]) into r8 ([boolean; 256u32]);\n deserialize.bits.raw r8 ([boolean; 256u32]) into r9 ([u8; 32u32]);\n cast r9[0u32] into r10 as u64;\n shl r10 56u32 into r11;\n add 0u64 r11 into r12;\n cast r9[1u32] into r13 as u64;\n shl r13 48u32 into r14;\n add r12 r14 into r15;\n cast r9[2u32] into r16 as u64;\n shl r16 40u32 into r17;\n add r15 r17 into r18;\n cast r9[3u32] into r19 as u64;\n shl r19 32u32 into r20;\n add r18 r20 into r21;\n cast r9[4u32] into r22 as u64;\n shl r22 24u32 into r23;\n add r21 r23 into r24;\n cast r9[5u32] into r25 as u64;\n shl r25 16u32 into r26;\n add r24 r26 into r27;\n cast r9[6u32] into r28 as u64;\n shl r28 8u32 into r29;\n add r27 r29 into r30;\n cast r9[7u32] into r31 as u64;\n shl r31 0u32 into r32;\n add r30 r32 into r33;\n cast r9[8u32] into r34 as u64;\n shl r34 56u32 into r35;\n add 0u64 r35 into r36;\n cast r9[9u32] into r37 as u64;\n shl r37 48u32 into r38;\n add r36 r38 into r39;\n cast r9[10u32] into r40 as u64;\n shl r40 40u32 into r41;\n add r39 r41 into r42;\n cast r9[11u32] into r43 as u64;\n shl r43 32u32 into r44;\n add r42 r44 into r45;\n cast r9[12u32] into r46 as u64;\n shl r46 24u32 into r47;\n add r45 r47 into r48;\n cast r9[13u32] into r49 as u64;\n shl r49 16u32 into r50;\n add r48 r50 into r51;\n cast r9[14u32] into r52 as u64;\n shl r52 8u32 into r53;\n add r51 r53 into r54;\n cast r9[15u32] into r55 as u64;\n shl r55 0u32 into r56;\n add r54 r56 into r57;\n cast r9[16u32] into r58 as u64;\n shl r58 56u32 into r59;\n add 0u64 r59 into r60;\n cast r9[17u32] into r61 as u64;\n shl r61 48u32 into r62;\n add r60 r62 into r63;\n cast r9[18u32] into r64 as u64;\n shl r64 40u32 into r65;\n add r63 r65 into r66;\n cast r9[19u32] into r67 as u64;\n shl r67 32u32 into r68;\n add r66 r68 into r69;\n cast r9[20u32] into r70 as u64;\n shl r70 24u32 into r71;\n add r69 r71 into r72;\n cast r9[21u32] into r73 as u64;\n shl r73 16u32 into r74;\n add r72 r74 into r75;\n cast r9[22u32] into r76 as u64;\n shl r76 8u32 into r77;\n add r75 r77 into r78;\n cast r9[23u32] into r79 as u64;\n shl r79 0u32 into r80;\n add r78 r80 into r81;\n cast r9[24u32] into r82 as u64;\n shl r82 56u32 into r83;\n add 0u64 r83 into r84;\n cast r9[25u32] into r85 as u64;\n shl r85 48u32 into r86;\n add r84 r86 into r87;\n cast r9[26u32] into r88 as u64;\n shl r88 40u32 into r89;\n add r87 r89 into r90;\n cast r9[27u32] into r91 as u64;\n shl r91 32u32 into r92;\n add r90 r92 into r93;\n cast r9[28u32] into r94 as u64;\n shl r94 24u32 into r95;\n add r93 r95 into r96;\n cast r9[29u32] into r97 as u64;\n shl r97 16u32 into r98;\n add r96 r98 into r99;\n cast r9[30u32] into r100 as u64;\n shl r100 8u32 into r101;\n add r99 r101 into r102;\n cast r9[31u32] into r103 as u64;\n shl r103 0u32 into r104;\n add r102 r104 into r105;\n shl 0u128 64u32 into r106;\n cast r33 into r107 as u128;\n or r106 r107 into r108;\n cast r7 into r109 as u128;\n div r108 r109 into r110;\n cast r110 into r111 as u64;\n cast r7 into r112 as u128;\n rem r108 r112 into r113;\n shl r113 64u32 into r114;\n cast r57 into r115 as u128;\n or r114 r115 into r116;\n cast r7 into r117 as u128;\n div r116 r117 into r118;\n cast r118 into r119 as u64;\n cast r7 into r120 as u128;\n rem r116 r120 into r121;\n shl r121 64u32 into r122;\n cast r81 into r123 as u128;\n or r122 r123 into r124;\n cast r7 into r125 as u128;\n div r124 r125 into r126;\n cast r126 into r127 as u64;\n cast r7 into r128 as u128;\n rem r124 r128 into r129;\n shl r129 64u32 into r130;\n cast r105 into r131 as u128;\n or r130 r131 into r132;\n cast r7 into r133 as u128;\n div r132 r133 into r134;\n cast r134 into r135 as u64;\n cast r7 into r136 as u128;\n rem r132 r136 into r137;\n assert.eq r111 0u64;\n assert.eq r119 0u64;\n assert.eq r127 0u64;\n call mailbox.aleo/process r0 r2 r3 r4 r5 into r138;\n cast r2.body[0u32] r2.body[1u32] into r139 as [u128; 2u32];\n serialize.bits.raw r139 ([u128; 2u32]) into r140 ([boolean; 256u32]);\n cast r140[0u32] r140[1u32] r140[2u32] r140[3u32] r140[4u32] r140[5u32] r140[6u32] r140[7u32] r140[8u32] r140[9u32] r140[10u32] r140[11u32] r140[12u32] r140[13u32] r140[14u32] r140[15u32] r140[16u32] r140[17u32] r140[18u32] r140[19u32] r140[20u32] r140[21u32] r140[22u32] r140[23u32] r140[24u32] r140[25u32] r140[26u32] r140[27u32] r140[28u32] r140[29u32] r140[30u32] r140[31u32] r140[32u32] r140[33u32] r140[34u32] r140[35u32] r140[36u32] r140[37u32] r140[38u32] r140[39u32] r140[40u32] r140[41u32] r140[42u32] r140[43u32] r140[44u32] r140[45u32] r140[46u32] r140[47u32] r140[48u32] r140[49u32] r140[50u32] r140[51u32] r140[52u32] r140[53u32] r140[54u32] r140[55u32] r140[56u32] r140[57u32] r140[58u32] r140[59u32] r140[60u32] r140[61u32] r140[62u32] r140[63u32] r140[64u32] r140[65u32] r140[66u32] r140[67u32] r140[68u32] r140[69u32] r140[70u32] r140[71u32] r140[72u32] r140[73u32] r140[74u32] r140[75u32] r140[76u32] r140[77u32] r140[78u32] r140[79u32] r140[80u32] r140[81u32] r140[82u32] r140[83u32] r140[84u32] r140[85u32] r140[86u32] r140[87u32] r140[88u32] r140[89u32] r140[90u32] r140[91u32] r140[92u32] r140[93u32] r140[94u32] r140[95u32] r140[96u32] r140[97u32] r140[98u32] r140[99u32] r140[100u32] r140[101u32] r140[102u32] r140[103u32] r140[104u32] r140[105u32] r140[106u32] r140[107u32] r140[108u32] r140[109u32] r140[110u32] r140[111u32] r140[112u32] r140[113u32] r140[114u32] r140[115u32] r140[116u32] r140[117u32] r140[118u32] r140[119u32] r140[120u32] r140[121u32] r140[122u32] r140[123u32] r140[124u32] r140[125u32] r140[126u32] r140[127u32] r140[128u32] r140[129u32] r140[130u32] r140[131u32] r140[132u32] r140[133u32] r140[134u32] r140[135u32] r140[136u32] r140[137u32] r140[138u32] r140[139u32] r140[140u32] r140[141u32] r140[142u32] r140[143u32] r140[144u32] r140[145u32] r140[146u32] r140[147u32] r140[148u32] r140[149u32] r140[150u32] r140[151u32] r140[152u32] r140[153u32] r140[154u32] r140[155u32] r140[156u32] r140[157u32] r140[158u32] r140[159u32] r140[160u32] r140[161u32] r140[162u32] r140[163u32] r140[164u32] r140[165u32] r140[166u32] r140[167u32] r140[168u32] r140[169u32] r140[170u32] r140[171u32] r140[172u32] r140[173u32] r140[174u32] r140[175u32] r140[176u32] r140[177u32] r140[178u32] r140[179u32] r140[180u32] r140[181u32] r140[182u32] r140[183u32] r140[184u32] r140[185u32] r140[186u32] r140[187u32] r140[188u32] r140[189u32] r140[190u32] r140[191u32] r140[192u32] r140[193u32] r140[194u32] r140[195u32] r140[196u32] r140[197u32] r140[198u32] r140[199u32] r140[200u32] r140[201u32] r140[202u32] r140[203u32] r140[204u32] r140[205u32] r140[206u32] r140[207u32] r140[208u32] r140[209u32] r140[210u32] r140[211u32] r140[212u32] r140[213u32] r140[214u32] r140[215u32] r140[216u32] r140[217u32] r140[218u32] r140[219u32] r140[220u32] r140[221u32] r140[222u32] r140[223u32] r140[224u32] r140[225u32] r140[226u32] r140[227u32] r140[228u32] r140[229u32] r140[230u32] r140[231u32] r140[232u32] r140[233u32] r140[234u32] r140[235u32] r140[236u32] r140[237u32] r140[238u32] r140[239u32] r140[240u32] r140[241u32] r140[242u32] r140[243u32] r140[244u32] r140[245u32] r140[246u32] r140[247u32] r140[248u32] r140[249u32] r140[250u32] r140[251u32] r140[252u32] into r141 as [boolean; 253u32];\n deserialize.bits.raw r141 ([boolean; 253u32]) into r142 (address);\n cast r135 into r143 as u64;\n call credits.aleo/transfer_public r142 r143 into r144;\n async process r138 r1 r2 r144 r0 into r145;\n output r145 as hyp_native.aleo/process.future;\n\nfinalize process:\n input r0 as mailbox.aleo/process.future;\n input r1 as Metadata.public;\n input r2 as Message.public;\n input r3 as credits.aleo/transfer_public.future;\n input r4 as address.public;\n get app_metadata[true] into r5;\n assert.eq r5 r1;\n get mailbox.aleo/mailbox[true] into r6;\n is.eq r5.ism aleo1qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq3ljyzc into r7;\n ternary r7 r6.default_ism r5.ism into r8;\n assert.eq r8 r4;\n get remote_routers[r2.origin_domain] into r9;\n assert.eq r9.recipient r2.sender;\n await r0;\n await r3;\n\nconstructor:\n assert.eq edition 0u16;\n`;
17
+ const hyp_synthetic = `import credits.aleo;\nimport ism_manager.aleo;\nimport mailbox.aleo;\nimport hook_manager.aleo;\nimport dispatch_proxy.aleo;\nimport token_registry.aleo;\nprogram hyp_synthetic.aleo;\n\nstruct RemoteRouter:\n domain as u32;\n recipient as [u8; 32u32];\n gas as u128;\n\nstruct Metadata:\n token_type as u8;\n token_owner as address;\n ism as address;\n hook as address;\n token_id as field;\n local_decimals as u8;\n remote_decimals as u8;\n\nstruct Message:\n version as u8;\n nonce as u32;\n origin_domain as u32;\n sender as [u8; 32u32];\n destination_domain as u32;\n recipient as [u8; 32u32];\n body as [u128; 16u32];\n\nstruct EthAddress:\n bytes as [u8; 20u32];\n\nstruct Mailbox:\n local_domain as u32;\n nonce as u32;\n process_count as u32;\n default_ism as address;\n default_hook as address;\n required_hook as address;\n dispatch_proxy as address;\n mailbox_owner as address;\n\nstruct CreditAllowance:\n spender as address;\n amount as u64;\n\nstruct HookMetadata:\n gas_limit as u128;\n extra_data as [u8; 64u32];\n\nstruct Tree:\n branch as [[u128; 2u32]; 32u32];\n count as u32;\n\nstruct DomainGasConfig:\n gas_overhead as u128;\n exchange_rate as u128;\n gas_price as u128;\n\nstruct MailboxState:\n default_hook as address;\n required_hook as address;\n\nstruct TokenMetadata:\n token_id as field;\n name as u128;\n symbol as u128;\n decimals as u8;\n supply as u128;\n max_supply as u128;\n admin as address;\n external_authorization_required as boolean;\n external_authorization_party as address;\n\nstruct TokenOwner:\n account as address;\n token_id as field;\n\nmapping remote_routers:\n key as u32.public;\n value as RemoteRouter.public;\n\nmapping remote_router_iter:\n key as u32.public;\n value as u32.public;\n\nmapping remote_router_length:\n key as boolean.public;\n value as u32.public;\n\nmapping app_metadata:\n key as boolean.public;\n value as Metadata.public;\n\nfunction init:\n input r0 as [u8; 128u32].public;\n input r1 as u128.public;\n input r2 as u128.public;\n input r3 as u8.public;\n input r4 as u8.public;\n cast hyp_synthetic.aleo into r5 as field;\n cast r4 into r6 as i16;\n cast r3 into r7 as i16;\n sub r6 r7 into r8;\n abs r8 into r9;\n lte r9 18i16 into r10;\n assert.eq r10 true;\n call token_registry.aleo/register_token r5 r1 r2 r3 340282366920938463463374607431768211455u128 false aleo1qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq3ljyzc into r11;\n call mailbox.aleo/register_application r0 into r12;\n async init self.caller r5 r3 r4 r11 r12 into r13;\n output r13 as hyp_synthetic.aleo/init.future;\n\nfinalize init:\n input r0 as address.public;\n input r1 as field.public;\n input r2 as u8.public;\n input r3 as u8.public;\n input r4 as token_registry.aleo/register_token.future;\n input r5 as mailbox.aleo/register_application.future;\n contains app_metadata[true] into r6;\n assert.eq r6 false;\n cast 1u8 r0 aleo1qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq3ljyzc aleo1qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq3ljyzc r1 r2 r3 into r7 as Metadata;\n set r7 into app_metadata[true];\n await r4;\n await r5;\n\nfunction get_address:\n output hyp_synthetic.aleo as address.private;\n\nfunction set_custom_hook:\n input r0 as address.private;\n async set_custom_hook self.caller r0 into r1;\n output r1 as hyp_synthetic.aleo/set_custom_hook.future;\n\nfinalize set_custom_hook:\n input r0 as address.public;\n input r1 as address.public;\n get app_metadata[true] into r2;\n assert.eq r2.token_owner r0;\n cast r2.token_type r2.token_owner r2.ism r1 r2.token_id r2.local_decimals r2.remote_decimals into r3 as Metadata;\n set r3 into app_metadata[true];\n\nfunction set_custom_ism:\n input r0 as address.private;\n async set_custom_ism self.caller r0 into r1;\n output r1 as hyp_synthetic.aleo/set_custom_ism.future;\n\nfinalize set_custom_ism:\n input r0 as address.public;\n input r1 as address.public;\n get app_metadata[true] into r2;\n assert.eq r2.token_owner r0;\n cast r2.token_type r2.token_owner r1 r2.hook r2.token_id r2.local_decimals r2.remote_decimals into r3 as Metadata;\n set r3 into app_metadata[true];\n\nfunction set_owner:\n input r0 as address.private;\n async set_owner self.caller r0 into r1;\n output r1 as hyp_synthetic.aleo/set_owner.future;\n\nfinalize set_owner:\n input r0 as address.public;\n input r1 as address.public;\n get app_metadata[true] into r2;\n assert.eq r2.token_owner r0;\n cast r2.token_type r1 r2.ism r2.hook r2.token_id r2.local_decimals r2.remote_decimals into r3 as Metadata;\n set r3 into app_metadata[true];\n\nfunction enroll_remote_router:\n input r0 as u32.private;\n input r1 as [u8; 32u32].private;\n input r2 as u128.private;\n async enroll_remote_router self.caller r0 r1 r2 into r3;\n output r3 as hyp_synthetic.aleo/enroll_remote_router.future;\n\nfinalize enroll_remote_router:\n input r0 as address.public;\n input r1 as u32.public;\n input r2 as [u8; 32u32].public;\n input r3 as u128.public;\n get app_metadata[true] into r4;\n assert.eq r4.token_owner r0;\n contains remote_routers[r1] into r5;\n not r5 into r6;\n branch.eq r6 false to end_then_0_0;\n get.or_use remote_router_length[true] 0u32 into r7;\n set r1 into remote_router_iter[r7];\n add r7 1u32 into r8;\n set r8 into remote_router_length[true];\n branch.eq true true to end_otherwise_0_1;\n position end_then_0_0;\n position end_otherwise_0_1;\n cast r1 r2 r3 into r9 as RemoteRouter;\n set r9 into remote_routers[r1];\n\nfunction unroll_remote_router:\n input r0 as u32.private;\n async unroll_remote_router self.caller r0 into r1;\n output r1 as hyp_synthetic.aleo/unroll_remote_router.future;\n\nfinalize unroll_remote_router:\n input r0 as address.public;\n input r1 as u32.public;\n get app_metadata[true] into r2;\n assert.eq r2.token_owner r0;\n remove remote_routers[r1];\n\nfunction transfer_remote:\n input r0 as Metadata.public;\n input r1 as MailboxState.public;\n input r2 as RemoteRouter.public;\n input r3 as u32.public;\n input r4 as [u128; 2u32].public;\n input r5 as u128.public;\n input r6 as [CreditAllowance; 4u32].public;\n cast 0u8 0u8 0u8 0u8 0u8 0u8 0u8 0u8 0u8 0u8 0u8 0u8 0u8 0u8 0u8 0u8 0u8 0u8 0u8 0u8 0u8 0u8 0u8 0u8 0u8 0u8 0u8 0u8 0u8 0u8 0u8 0u8 0u8 0u8 0u8 0u8 0u8 0u8 0u8 0u8 0u8 0u8 0u8 0u8 0u8 0u8 0u8 0u8 0u8 0u8 0u8 0u8 0u8 0u8 0u8 0u8 0u8 0u8 0u8 0u8 0u8 0u8 0u8 0u8 into r7 as [u8; 64u32];\n cast r2.gas r7 into r8 as HookMetadata;\n is.eq r0.local_decimals r0.remote_decimals into r9;\n shr r5 0u8 into r10;\n rem r10 256u128 into r11;\n shl r11 120u8 into r12;\n add 0u128 r12 into r13;\n shr r5 8u8 into r14;\n rem r14 256u128 into r15;\n shl r15 112u8 into r16;\n add r13 r16 into r17;\n shr r5 16u8 into r18;\n rem r18 256u128 into r19;\n shl r19 104u8 into r20;\n add r17 r20 into r21;\n shr r5 24u8 into r22;\n rem r22 256u128 into r23;\n shl r23 96u8 into r24;\n add r21 r24 into r25;\n shr r5 32u8 into r26;\n rem r26 256u128 into r27;\n shl r27 88u8 into r28;\n add r25 r28 into r29;\n shr r5 40u8 into r30;\n rem r30 256u128 into r31;\n shl r31 80u8 into r32;\n add r29 r32 into r33;\n shr r5 48u8 into r34;\n rem r34 256u128 into r35;\n shl r35 72u8 into r36;\n add r33 r36 into r37;\n shr r5 56u8 into r38;\n rem r38 256u128 into r39;\n shl r39 64u8 into r40;\n add r37 r40 into r41;\n shr r5 64u8 into r42;\n rem r42 256u128 into r43;\n shl r43 56u8 into r44;\n add r41 r44 into r45;\n shr r5 72u8 into r46;\n rem r46 256u128 into r47;\n shl r47 48u8 into r48;\n add r45 r48 into r49;\n shr r5 80u8 into r50;\n rem r50 256u128 into r51;\n shl r51 40u8 into r52;\n add r49 r52 into r53;\n shr r5 88u8 into r54;\n rem r54 256u128 into r55;\n shl r55 32u8 into r56;\n add r53 r56 into r57;\n shr r5 96u8 into r58;\n rem r58 256u128 into r59;\n shl r59 24u8 into r60;\n add r57 r60 into r61;\n shr r5 104u8 into r62;\n rem r62 256u128 into r63;\n shl r63 16u8 into r64;\n add r61 r64 into r65;\n shr r5 112u8 into r66;\n rem r66 256u128 into r67;\n shl r67 8u8 into r68;\n add r65 r68 into r69;\n shr r5 120u8 into r70;\n rem r70 256u128 into r71;\n shl r71 0u8 into r72;\n add r69 r72 into r73;\n cast 0u128 r73 into r74 as [u128; 2u32];\n lt r0.remote_decimals r0.local_decimals into r75;\n lt r0.local_decimals r0.remote_decimals into r76;\n ternary r76 r0.remote_decimals r0.local_decimals into r77;\n sub r77 r0.remote_decimals into r78;\n pow 10u128 r78 into r79;\n div r5 r79 into r80;\n shr r80 0u8 into r81;\n rem r81 256u128 into r82;\n shl r82 120u8 into r83;\n add 0u128 r83 into r84;\n shr r80 8u8 into r85;\n rem r85 256u128 into r86;\n shl r86 112u8 into r87;\n add r84 r87 into r88;\n shr r80 16u8 into r89;\n rem r89 256u128 into r90;\n shl r90 104u8 into r91;\n add r88 r91 into r92;\n shr r80 24u8 into r93;\n rem r93 256u128 into r94;\n shl r94 96u8 into r95;\n add r92 r95 into r96;\n shr r80 32u8 into r97;\n rem r97 256u128 into r98;\n shl r98 88u8 into r99;\n add r96 r99 into r100;\n shr r80 40u8 into r101;\n rem r101 256u128 into r102;\n shl r102 80u8 into r103;\n add r100 r103 into r104;\n shr r80 48u8 into r105;\n rem r105 256u128 into r106;\n shl r106 72u8 into r107;\n add r104 r107 into r108;\n shr r80 56u8 into r109;\n rem r109 256u128 into r110;\n shl r110 64u8 into r111;\n add r108 r111 into r112;\n shr r80 64u8 into r113;\n rem r113 256u128 into r114;\n shl r114 56u8 into r115;\n add r112 r115 into r116;\n shr r80 72u8 into r117;\n rem r117 256u128 into r118;\n shl r118 48u8 into r119;\n add r116 r119 into r120;\n shr r80 80u8 into r121;\n rem r121 256u128 into r122;\n shl r122 40u8 into r123;\n add r120 r123 into r124;\n shr r80 88u8 into r125;\n rem r125 256u128 into r126;\n shl r126 32u8 into r127;\n add r124 r127 into r128;\n shr r80 96u8 into r129;\n rem r129 256u128 into r130;\n shl r130 24u8 into r131;\n add r128 r131 into r132;\n shr r80 104u8 into r133;\n rem r133 256u128 into r134;\n shl r134 16u8 into r135;\n add r132 r135 into r136;\n shr r80 112u8 into r137;\n rem r137 256u128 into r138;\n shl r138 8u8 into r139;\n add r136 r139 into r140;\n shr r80 120u8 into r141;\n rem r141 256u128 into r142;\n shl r142 0u8 into r143;\n add r140 r143 into r144;\n cast 0u128 r144 into r145 as [u128; 2u32];\n not r75 into r146;\n gt r0.local_decimals r0.remote_decimals into r147;\n ternary r147 r0.remote_decimals r0.local_decimals into r148;\n cast 0u64 0u64 0u64 0u64 into r149 as [u64; 4u32];\n shr r5 64u32 into r150;\n cast r150 into r151 as u64;\n and r5 18446744073709551615u128 into r152;\n cast r152 into r153 as u64;\n sub r0.remote_decimals r148 into r154;\n pow 10u64 r154 into r155;\n cast r153 into r156 as u128;\n cast r155 into r157 as u128;\n mul r156 r157 into r158;\n add r158 0u128 into r159;\n and r159 18446744073709551615u128 into r160;\n cast r160 into r161 as u64;\n shr r159 64u32 into r162;\n cast r151 into r163 as u128;\n cast r155 into r164 as u128;\n mul r163 r164 into r165;\n add r165 r162 into r166;\n and r166 18446744073709551615u128 into r167;\n cast r167 into r168 as u64;\n shr r166 64u32 into r169;\n cast r149[1u32] into r170 as u128;\n cast r155 into r171 as u128;\n mul r170 r171 into r172;\n add r172 r169 into r173;\n and r173 18446744073709551615u128 into r174;\n cast r174 into r175 as u64;\n shr r173 64u32 into r176;\n cast r149[0u32] into r177 as u128;\n cast r155 into r178 as u128;\n mul r177 r178 into r179;\n add r179 r176 into r180;\n and r180 18446744073709551615u128 into r181;\n cast r181 into r182 as u64;\n shr r180 64u32 into r183;\n not r146 into r184;\n or r9 r75 into r185;\n is.eq r183 0u128 into r186;\n or r186 r184 into r187;\n or r187 r185 into r188;\n assert.eq r188 true;\n cast r182 into r189 as u128;\n shl r189 64u32 into r190;\n cast r175 into r191 as u128;\n add r190 r191 into r192;\n cast r168 into r193 as u128;\n shl r193 64u32 into r194;\n cast r161 into r195 as u128;\n add r194 r195 into r196;\n shr r192 0u8 into r197;\n rem r197 256u128 into r198;\n shl r198 120u8 into r199;\n add 0u128 r199 into r200;\n shr r192 8u8 into r201;\n rem r201 256u128 into r202;\n shl r202 112u8 into r203;\n add r200 r203 into r204;\n shr r192 16u8 into r205;\n rem r205 256u128 into r206;\n shl r206 104u8 into r207;\n add r204 r207 into r208;\n shr r192 24u8 into r209;\n rem r209 256u128 into r210;\n shl r210 96u8 into r211;\n add r208 r211 into r212;\n shr r192 32u8 into r213;\n rem r213 256u128 into r214;\n shl r214 88u8 into r215;\n add r212 r215 into r216;\n shr r192 40u8 into r217;\n rem r217 256u128 into r218;\n shl r218 80u8 into r219;\n add r216 r219 into r220;\n shr r192 48u8 into r221;\n rem r221 256u128 into r222;\n shl r222 72u8 into r223;\n add r220 r223 into r224;\n shr r192 56u8 into r225;\n rem r225 256u128 into r226;\n shl r226 64u8 into r227;\n add r224 r227 into r228;\n shr r192 64u8 into r229;\n rem r229 256u128 into r230;\n shl r230 56u8 into r231;\n add r228 r231 into r232;\n shr r192 72u8 into r233;\n rem r233 256u128 into r234;\n shl r234 48u8 into r235;\n add r232 r235 into r236;\n shr r192 80u8 into r237;\n rem r237 256u128 into r238;\n shl r238 40u8 into r239;\n add r236 r239 into r240;\n shr r192 88u8 into r241;\n rem r241 256u128 into r242;\n shl r242 32u8 into r243;\n add r240 r243 into r244;\n shr r192 96u8 into r245;\n rem r245 256u128 into r246;\n shl r246 24u8 into r247;\n add r244 r247 into r248;\n shr r192 104u8 into r249;\n rem r249 256u128 into r250;\n shl r250 16u8 into r251;\n add r248 r251 into r252;\n shr r192 112u8 into r253;\n rem r253 256u128 into r254;\n shl r254 8u8 into r255;\n add r252 r255 into r256;\n shr r192 120u8 into r257;\n rem r257 256u128 into r258;\n shl r258 0u8 into r259;\n add r256 r259 into r260;\n shr r196 0u8 into r261;\n rem r261 256u128 into r262;\n shl r262 120u8 into r263;\n add 0u128 r263 into r264;\n shr r196 8u8 into r265;\n rem r265 256u128 into r266;\n shl r266 112u8 into r267;\n add r264 r267 into r268;\n shr r196 16u8 into r269;\n rem r269 256u128 into r270;\n shl r270 104u8 into r271;\n add r268 r271 into r272;\n shr r196 24u8 into r273;\n rem r273 256u128 into r274;\n shl r274 96u8 into r275;\n add r272 r275 into r276;\n shr r196 32u8 into r277;\n rem r277 256u128 into r278;\n shl r278 88u8 into r279;\n add r276 r279 into r280;\n shr r196 40u8 into r281;\n rem r281 256u128 into r282;\n shl r282 80u8 into r283;\n add r280 r283 into r284;\n shr r196 48u8 into r285;\n rem r285 256u128 into r286;\n shl r286 72u8 into r287;\n add r284 r287 into r288;\n shr r196 56u8 into r289;\n rem r289 256u128 into r290;\n shl r290 64u8 into r291;\n add r288 r291 into r292;\n shr r196 64u8 into r293;\n rem r293 256u128 into r294;\n shl r294 56u8 into r295;\n add r292 r295 into r296;\n shr r196 72u8 into r297;\n rem r297 256u128 into r298;\n shl r298 48u8 into r299;\n add r296 r299 into r300;\n shr r196 80u8 into r301;\n rem r301 256u128 into r302;\n shl r302 40u8 into r303;\n add r300 r303 into r304;\n shr r196 88u8 into r305;\n rem r305 256u128 into r306;\n shl r306 32u8 into r307;\n add r304 r307 into r308;\n shr r196 96u8 into r309;\n rem r309 256u128 into r310;\n shl r310 24u8 into r311;\n add r308 r311 into r312;\n shr r196 104u8 into r313;\n rem r313 256u128 into r314;\n shl r314 16u8 into r315;\n add r312 r315 into r316;\n shr r196 112u8 into r317;\n rem r317 256u128 into r318;\n shl r318 8u8 into r319;\n add r316 r319 into r320;\n shr r196 120u8 into r321;\n rem r321 256u128 into r322;\n shl r322 0u8 into r323;\n add r320 r323 into r324;\n cast r260 r324 into r325 as [u128; 2u32];\n ternary r75 r145[0u32] r325[0u32] into r326;\n ternary r75 r145[1u32] r325[1u32] into r327;\n cast r326 r327 into r328 as [u128; 2u32];\n ternary r9 r74[0u32] r328[0u32] into r329;\n ternary r9 r74[1u32] r328[1u32] into r330;\n cast r329 r330 into r331 as [u128; 2u32];\n cast 0u128 0u128 0u128 0u128 0u128 0u128 0u128 0u128 0u128 0u128 0u128 0u128 0u128 0u128 0u128 0u128 into r332 as [u128; 16u32];\n cast r4[0u32] r4[1u32] r331[0u32] r331[1u32] r332[4u32] r332[5u32] r332[6u32] r332[7u32] r332[8u32] r332[9u32] r332[10u32] r332[11u32] r332[12u32] r332[13u32] r332[14u32] r332[15u32] into r333 as [u128; 16u32];\n call dispatch_proxy.aleo/dispatch r1 r3 r2.recipient r333 r0.hook r8 r6 into r334;\n call token_registry.aleo/burn_public r0.token_id self.signer r5 into r335;\n async transfer_remote r334 r335 r2 r3 r0 into r336;\n output r336 as hyp_synthetic.aleo/transfer_remote.future;\n\nfinalize transfer_remote:\n input r0 as dispatch_proxy.aleo/dispatch.future;\n input r1 as token_registry.aleo/burn_public.future;\n input r2 as RemoteRouter.public;\n input r3 as u32.public;\n input r4 as Metadata.public;\n get remote_routers[r3] into r5;\n assert.eq r5 r2;\n get app_metadata[true] into r6;\n assert.eq r4 r6;\n await r0;\n await r1;\n\nfunction transfer_remote_with_hook:\n input r0 as Metadata.public;\n input r1 as MailboxState.public;\n input r2 as RemoteRouter.public;\n input r3 as u32.public;\n input r4 as [u128; 2u32].public;\n input r5 as u128.public;\n input r6 as [CreditAllowance; 4u32].public;\n input r7 as address.public;\n input r8 as HookMetadata.public;\n is.eq r8.gas_limit 0u128 into r9;\n ternary r9 r2.gas r8.gas_limit into r10;\n is.eq r0.local_decimals r0.remote_decimals into r11;\n shr r5 0u8 into r12;\n rem r12 256u128 into r13;\n shl r13 120u8 into r14;\n add 0u128 r14 into r15;\n shr r5 8u8 into r16;\n rem r16 256u128 into r17;\n shl r17 112u8 into r18;\n add r15 r18 into r19;\n shr r5 16u8 into r20;\n rem r20 256u128 into r21;\n shl r21 104u8 into r22;\n add r19 r22 into r23;\n shr r5 24u8 into r24;\n rem r24 256u128 into r25;\n shl r25 96u8 into r26;\n add r23 r26 into r27;\n shr r5 32u8 into r28;\n rem r28 256u128 into r29;\n shl r29 88u8 into r30;\n add r27 r30 into r31;\n shr r5 40u8 into r32;\n rem r32 256u128 into r33;\n shl r33 80u8 into r34;\n add r31 r34 into r35;\n shr r5 48u8 into r36;\n rem r36 256u128 into r37;\n shl r37 72u8 into r38;\n add r35 r38 into r39;\n shr r5 56u8 into r40;\n rem r40 256u128 into r41;\n shl r41 64u8 into r42;\n add r39 r42 into r43;\n shr r5 64u8 into r44;\n rem r44 256u128 into r45;\n shl r45 56u8 into r46;\n add r43 r46 into r47;\n shr r5 72u8 into r48;\n rem r48 256u128 into r49;\n shl r49 48u8 into r50;\n add r47 r50 into r51;\n shr r5 80u8 into r52;\n rem r52 256u128 into r53;\n shl r53 40u8 into r54;\n add r51 r54 into r55;\n shr r5 88u8 into r56;\n rem r56 256u128 into r57;\n shl r57 32u8 into r58;\n add r55 r58 into r59;\n shr r5 96u8 into r60;\n rem r60 256u128 into r61;\n shl r61 24u8 into r62;\n add r59 r62 into r63;\n shr r5 104u8 into r64;\n rem r64 256u128 into r65;\n shl r65 16u8 into r66;\n add r63 r66 into r67;\n shr r5 112u8 into r68;\n rem r68 256u128 into r69;\n shl r69 8u8 into r70;\n add r67 r70 into r71;\n shr r5 120u8 into r72;\n rem r72 256u128 into r73;\n shl r73 0u8 into r74;\n add r71 r74 into r75;\n cast 0u128 r75 into r76 as [u128; 2u32];\n lt r0.remote_decimals r0.local_decimals into r77;\n lt r0.local_decimals r0.remote_decimals into r78;\n ternary r78 r0.remote_decimals r0.local_decimals into r79;\n sub r79 r0.remote_decimals into r80;\n pow 10u128 r80 into r81;\n div r5 r81 into r82;\n shr r82 0u8 into r83;\n rem r83 256u128 into r84;\n shl r84 120u8 into r85;\n add 0u128 r85 into r86;\n shr r82 8u8 into r87;\n rem r87 256u128 into r88;\n shl r88 112u8 into r89;\n add r86 r89 into r90;\n shr r82 16u8 into r91;\n rem r91 256u128 into r92;\n shl r92 104u8 into r93;\n add r90 r93 into r94;\n shr r82 24u8 into r95;\n rem r95 256u128 into r96;\n shl r96 96u8 into r97;\n add r94 r97 into r98;\n shr r82 32u8 into r99;\n rem r99 256u128 into r100;\n shl r100 88u8 into r101;\n add r98 r101 into r102;\n shr r82 40u8 into r103;\n rem r103 256u128 into r104;\n shl r104 80u8 into r105;\n add r102 r105 into r106;\n shr r82 48u8 into r107;\n rem r107 256u128 into r108;\n shl r108 72u8 into r109;\n add r106 r109 into r110;\n shr r82 56u8 into r111;\n rem r111 256u128 into r112;\n shl r112 64u8 into r113;\n add r110 r113 into r114;\n shr r82 64u8 into r115;\n rem r115 256u128 into r116;\n shl r116 56u8 into r117;\n add r114 r117 into r118;\n shr r82 72u8 into r119;\n rem r119 256u128 into r120;\n shl r120 48u8 into r121;\n add r118 r121 into r122;\n shr r82 80u8 into r123;\n rem r123 256u128 into r124;\n shl r124 40u8 into r125;\n add r122 r125 into r126;\n shr r82 88u8 into r127;\n rem r127 256u128 into r128;\n shl r128 32u8 into r129;\n add r126 r129 into r130;\n shr r82 96u8 into r131;\n rem r131 256u128 into r132;\n shl r132 24u8 into r133;\n add r130 r133 into r134;\n shr r82 104u8 into r135;\n rem r135 256u128 into r136;\n shl r136 16u8 into r137;\n add r134 r137 into r138;\n shr r82 112u8 into r139;\n rem r139 256u128 into r140;\n shl r140 8u8 into r141;\n add r138 r141 into r142;\n shr r82 120u8 into r143;\n rem r143 256u128 into r144;\n shl r144 0u8 into r145;\n add r142 r145 into r146;\n cast 0u128 r146 into r147 as [u128; 2u32];\n not r77 into r148;\n gt r0.local_decimals r0.remote_decimals into r149;\n ternary r149 r0.remote_decimals r0.local_decimals into r150;\n cast 0u64 0u64 0u64 0u64 into r151 as [u64; 4u32];\n shr r5 64u32 into r152;\n cast r152 into r153 as u64;\n and r5 18446744073709551615u128 into r154;\n cast r154 into r155 as u64;\n sub r0.remote_decimals r150 into r156;\n pow 10u64 r156 into r157;\n cast r155 into r158 as u128;\n cast r157 into r159 as u128;\n mul r158 r159 into r160;\n add r160 0u128 into r161;\n and r161 18446744073709551615u128 into r162;\n cast r162 into r163 as u64;\n shr r161 64u32 into r164;\n cast r153 into r165 as u128;\n cast r157 into r166 as u128;\n mul r165 r166 into r167;\n add r167 r164 into r168;\n and r168 18446744073709551615u128 into r169;\n cast r169 into r170 as u64;\n shr r168 64u32 into r171;\n cast r151[1u32] into r172 as u128;\n cast r157 into r173 as u128;\n mul r172 r173 into r174;\n add r174 r171 into r175;\n and r175 18446744073709551615u128 into r176;\n cast r176 into r177 as u64;\n shr r175 64u32 into r178;\n cast r151[0u32] into r179 as u128;\n cast r157 into r180 as u128;\n mul r179 r180 into r181;\n add r181 r178 into r182;\n and r182 18446744073709551615u128 into r183;\n cast r183 into r184 as u64;\n shr r182 64u32 into r185;\n not r148 into r186;\n or r11 r77 into r187;\n is.eq r185 0u128 into r188;\n or r188 r186 into r189;\n or r189 r187 into r190;\n assert.eq r190 true;\n cast r184 into r191 as u128;\n shl r191 64u32 into r192;\n cast r177 into r193 as u128;\n add r192 r193 into r194;\n cast r170 into r195 as u128;\n shl r195 64u32 into r196;\n cast r163 into r197 as u128;\n add r196 r197 into r198;\n shr r194 0u8 into r199;\n rem r199 256u128 into r200;\n shl r200 120u8 into r201;\n add 0u128 r201 into r202;\n shr r194 8u8 into r203;\n rem r203 256u128 into r204;\n shl r204 112u8 into r205;\n add r202 r205 into r206;\n shr r194 16u8 into r207;\n rem r207 256u128 into r208;\n shl r208 104u8 into r209;\n add r206 r209 into r210;\n shr r194 24u8 into r211;\n rem r211 256u128 into r212;\n shl r212 96u8 into r213;\n add r210 r213 into r214;\n shr r194 32u8 into r215;\n rem r215 256u128 into r216;\n shl r216 88u8 into r217;\n add r214 r217 into r218;\n shr r194 40u8 into r219;\n rem r219 256u128 into r220;\n shl r220 80u8 into r221;\n add r218 r221 into r222;\n shr r194 48u8 into r223;\n rem r223 256u128 into r224;\n shl r224 72u8 into r225;\n add r222 r225 into r226;\n shr r194 56u8 into r227;\n rem r227 256u128 into r228;\n shl r228 64u8 into r229;\n add r226 r229 into r230;\n shr r194 64u8 into r231;\n rem r231 256u128 into r232;\n shl r232 56u8 into r233;\n add r230 r233 into r234;\n shr r194 72u8 into r235;\n rem r235 256u128 into r236;\n shl r236 48u8 into r237;\n add r234 r237 into r238;\n shr r194 80u8 into r239;\n rem r239 256u128 into r240;\n shl r240 40u8 into r241;\n add r238 r241 into r242;\n shr r194 88u8 into r243;\n rem r243 256u128 into r244;\n shl r244 32u8 into r245;\n add r242 r245 into r246;\n shr r194 96u8 into r247;\n rem r247 256u128 into r248;\n shl r248 24u8 into r249;\n add r246 r249 into r250;\n shr r194 104u8 into r251;\n rem r251 256u128 into r252;\n shl r252 16u8 into r253;\n add r250 r253 into r254;\n shr r194 112u8 into r255;\n rem r255 256u128 into r256;\n shl r256 8u8 into r257;\n add r254 r257 into r258;\n shr r194 120u8 into r259;\n rem r259 256u128 into r260;\n shl r260 0u8 into r261;\n add r258 r261 into r262;\n shr r198 0u8 into r263;\n rem r263 256u128 into r264;\n shl r264 120u8 into r265;\n add 0u128 r265 into r266;\n shr r198 8u8 into r267;\n rem r267 256u128 into r268;\n shl r268 112u8 into r269;\n add r266 r269 into r270;\n shr r198 16u8 into r271;\n rem r271 256u128 into r272;\n shl r272 104u8 into r273;\n add r270 r273 into r274;\n shr r198 24u8 into r275;\n rem r275 256u128 into r276;\n shl r276 96u8 into r277;\n add r274 r277 into r278;\n shr r198 32u8 into r279;\n rem r279 256u128 into r280;\n shl r280 88u8 into r281;\n add r278 r281 into r282;\n shr r198 40u8 into r283;\n rem r283 256u128 into r284;\n shl r284 80u8 into r285;\n add r282 r285 into r286;\n shr r198 48u8 into r287;\n rem r287 256u128 into r288;\n shl r288 72u8 into r289;\n add r286 r289 into r290;\n shr r198 56u8 into r291;\n rem r291 256u128 into r292;\n shl r292 64u8 into r293;\n add r290 r293 into r294;\n shr r198 64u8 into r295;\n rem r295 256u128 into r296;\n shl r296 56u8 into r297;\n add r294 r297 into r298;\n shr r198 72u8 into r299;\n rem r299 256u128 into r300;\n shl r300 48u8 into r301;\n add r298 r301 into r302;\n shr r198 80u8 into r303;\n rem r303 256u128 into r304;\n shl r304 40u8 into r305;\n add r302 r305 into r306;\n shr r198 88u8 into r307;\n rem r307 256u128 into r308;\n shl r308 32u8 into r309;\n add r306 r309 into r310;\n shr r198 96u8 into r311;\n rem r311 256u128 into r312;\n shl r312 24u8 into r313;\n add r310 r313 into r314;\n shr r198 104u8 into r315;\n rem r315 256u128 into r316;\n shl r316 16u8 into r317;\n add r314 r317 into r318;\n shr r198 112u8 into r319;\n rem r319 256u128 into r320;\n shl r320 8u8 into r321;\n add r318 r321 into r322;\n shr r198 120u8 into r323;\n rem r323 256u128 into r324;\n shl r324 0u8 into r325;\n add r322 r325 into r326;\n cast r262 r326 into r327 as [u128; 2u32];\n ternary r77 r147[0u32] r327[0u32] into r328;\n ternary r77 r147[1u32] r327[1u32] into r329;\n cast r328 r329 into r330 as [u128; 2u32];\n ternary r11 r76[0u32] r330[0u32] into r331;\n ternary r11 r76[1u32] r330[1u32] into r332;\n cast r331 r332 into r333 as [u128; 2u32];\n cast 0u128 0u128 0u128 0u128 0u128 0u128 0u128 0u128 0u128 0u128 0u128 0u128 0u128 0u128 0u128 0u128 into r334 as [u128; 16u32];\n cast r4[0u32] r4[1u32] r333[0u32] r333[1u32] r334[4u32] r334[5u32] r334[6u32] r334[7u32] r334[8u32] r334[9u32] r334[10u32] r334[11u32] r334[12u32] r334[13u32] r334[14u32] r334[15u32] into r335 as [u128; 16u32];\n cast r10 r8.extra_data into r336 as HookMetadata;\n call dispatch_proxy.aleo/dispatch r1 r3 r2.recipient r335 r7 r336 r6 into r337;\n call token_registry.aleo/burn_public r0.token_id self.signer r5 into r338;\n async transfer_remote_with_hook r337 r338 r2 r3 r0 into r339;\n output r339 as hyp_synthetic.aleo/transfer_remote_with_hook.future;\n\nfinalize transfer_remote_with_hook:\n input r0 as dispatch_proxy.aleo/dispatch.future;\n input r1 as token_registry.aleo/burn_public.future;\n input r2 as RemoteRouter.public;\n input r3 as u32.public;\n input r4 as Metadata.public;\n get remote_routers[r3] into r5;\n assert.eq r5 r2;\n get app_metadata[true] into r6;\n assert.eq r4 r6;\n await r0;\n await r1;\n\nfunction process:\n input r0 as address.public;\n input r1 as Metadata.public;\n input r2 as Message.public;\n input r3 as u32.public;\n input r4 as [u128; 2u32].public;\n input r5 as [u8; 512u32].public;\n call mailbox.aleo/process r0 r2 r3 r4 r5 into r6;\n cast r2.body[0u32] r2.body[1u32] into r7 as [u128; 2u32];\n serialize.bits.raw r7 ([u128; 2u32]) into r8 ([boolean; 256u32]);\n cast r8[0u32] r8[1u32] r8[2u32] r8[3u32] r8[4u32] r8[5u32] r8[6u32] r8[7u32] r8[8u32] r8[9u32] r8[10u32] r8[11u32] r8[12u32] r8[13u32] r8[14u32] r8[15u32] r8[16u32] r8[17u32] r8[18u32] r8[19u32] r8[20u32] r8[21u32] r8[22u32] r8[23u32] r8[24u32] r8[25u32] r8[26u32] r8[27u32] r8[28u32] r8[29u32] r8[30u32] r8[31u32] r8[32u32] r8[33u32] r8[34u32] r8[35u32] r8[36u32] r8[37u32] r8[38u32] r8[39u32] r8[40u32] r8[41u32] r8[42u32] r8[43u32] r8[44u32] r8[45u32] r8[46u32] r8[47u32] r8[48u32] r8[49u32] r8[50u32] r8[51u32] r8[52u32] r8[53u32] r8[54u32] r8[55u32] r8[56u32] r8[57u32] r8[58u32] r8[59u32] r8[60u32] r8[61u32] r8[62u32] r8[63u32] r8[64u32] r8[65u32] r8[66u32] r8[67u32] r8[68u32] r8[69u32] r8[70u32] r8[71u32] r8[72u32] r8[73u32] r8[74u32] r8[75u32] r8[76u32] r8[77u32] r8[78u32] r8[79u32] r8[80u32] r8[81u32] r8[82u32] r8[83u32] r8[84u32] r8[85u32] r8[86u32] r8[87u32] r8[88u32] r8[89u32] r8[90u32] r8[91u32] r8[92u32] r8[93u32] r8[94u32] r8[95u32] r8[96u32] r8[97u32] r8[98u32] r8[99u32] r8[100u32] r8[101u32] r8[102u32] r8[103u32] r8[104u32] r8[105u32] r8[106u32] r8[107u32] r8[108u32] r8[109u32] r8[110u32] r8[111u32] r8[112u32] r8[113u32] r8[114u32] r8[115u32] r8[116u32] r8[117u32] r8[118u32] r8[119u32] r8[120u32] r8[121u32] r8[122u32] r8[123u32] r8[124u32] r8[125u32] r8[126u32] r8[127u32] r8[128u32] r8[129u32] r8[130u32] r8[131u32] r8[132u32] r8[133u32] r8[134u32] r8[135u32] r8[136u32] r8[137u32] r8[138u32] r8[139u32] r8[140u32] r8[141u32] r8[142u32] r8[143u32] r8[144u32] r8[145u32] r8[146u32] r8[147u32] r8[148u32] r8[149u32] r8[150u32] r8[151u32] r8[152u32] r8[153u32] r8[154u32] r8[155u32] r8[156u32] r8[157u32] r8[158u32] r8[159u32] r8[160u32] r8[161u32] r8[162u32] r8[163u32] r8[164u32] r8[165u32] r8[166u32] r8[167u32] r8[168u32] r8[169u32] r8[170u32] r8[171u32] r8[172u32] r8[173u32] r8[174u32] r8[175u32] r8[176u32] r8[177u32] r8[178u32] r8[179u32] r8[180u32] r8[181u32] r8[182u32] r8[183u32] r8[184u32] r8[185u32] r8[186u32] r8[187u32] r8[188u32] r8[189u32] r8[190u32] r8[191u32] r8[192u32] r8[193u32] r8[194u32] r8[195u32] r8[196u32] r8[197u32] r8[198u32] r8[199u32] r8[200u32] r8[201u32] r8[202u32] r8[203u32] r8[204u32] r8[205u32] r8[206u32] r8[207u32] r8[208u32] r8[209u32] r8[210u32] r8[211u32] r8[212u32] r8[213u32] r8[214u32] r8[215u32] r8[216u32] r8[217u32] r8[218u32] r8[219u32] r8[220u32] r8[221u32] r8[222u32] r8[223u32] r8[224u32] r8[225u32] r8[226u32] r8[227u32] r8[228u32] r8[229u32] r8[230u32] r8[231u32] r8[232u32] r8[233u32] r8[234u32] r8[235u32] r8[236u32] r8[237u32] r8[238u32] r8[239u32] r8[240u32] r8[241u32] r8[242u32] r8[243u32] r8[244u32] r8[245u32] r8[246u32] r8[247u32] r8[248u32] r8[249u32] r8[250u32] r8[251u32] r8[252u32] into r9 as [boolean; 253u32];\n deserialize.bits.raw r9 ([boolean; 253u32]) into r10 (address);\n cast r2.body[2u32] r2.body[3u32] into r11 as [u128; 2u32];\n is.eq r1.local_decimals r1.remote_decimals into r12;\n shr r11[1u32] 0u8 into r13;\n rem r13 256u128 into r14;\n shl r14 120u8 into r15;\n add 0u128 r15 into r16;\n shr r11[1u32] 8u8 into r17;\n rem r17 256u128 into r18;\n shl r18 112u8 into r19;\n add r16 r19 into r20;\n shr r11[1u32] 16u8 into r21;\n rem r21 256u128 into r22;\n shl r22 104u8 into r23;\n add r20 r23 into r24;\n shr r11[1u32] 24u8 into r25;\n rem r25 256u128 into r26;\n shl r26 96u8 into r27;\n add r24 r27 into r28;\n shr r11[1u32] 32u8 into r29;\n rem r29 256u128 into r30;\n shl r30 88u8 into r31;\n add r28 r31 into r32;\n shr r11[1u32] 40u8 into r33;\n rem r33 256u128 into r34;\n shl r34 80u8 into r35;\n add r32 r35 into r36;\n shr r11[1u32] 48u8 into r37;\n rem r37 256u128 into r38;\n shl r38 72u8 into r39;\n add r36 r39 into r40;\n shr r11[1u32] 56u8 into r41;\n rem r41 256u128 into r42;\n shl r42 64u8 into r43;\n add r40 r43 into r44;\n shr r11[1u32] 64u8 into r45;\n rem r45 256u128 into r46;\n shl r46 56u8 into r47;\n add r44 r47 into r48;\n shr r11[1u32] 72u8 into r49;\n rem r49 256u128 into r50;\n shl r50 48u8 into r51;\n add r48 r51 into r52;\n shr r11[1u32] 80u8 into r53;\n rem r53 256u128 into r54;\n shl r54 40u8 into r55;\n add r52 r55 into r56;\n shr r11[1u32] 88u8 into r57;\n rem r57 256u128 into r58;\n shl r58 32u8 into r59;\n add r56 r59 into r60;\n shr r11[1u32] 96u8 into r61;\n rem r61 256u128 into r62;\n shl r62 24u8 into r63;\n add r60 r63 into r64;\n shr r11[1u32] 104u8 into r65;\n rem r65 256u128 into r66;\n shl r66 16u8 into r67;\n add r64 r67 into r68;\n shr r11[1u32] 112u8 into r69;\n rem r69 256u128 into r70;\n shl r70 8u8 into r71;\n add r68 r71 into r72;\n shr r11[1u32] 120u8 into r73;\n rem r73 256u128 into r74;\n shl r74 0u8 into r75;\n add r72 r75 into r76;\n lt r1.remote_decimals r1.local_decimals into r77;\n lt r1.local_decimals r1.remote_decimals into r78;\n ternary r78 r1.remote_decimals r1.local_decimals into r79;\n sub r79 r1.remote_decimals into r80;\n not r77 into r81;\n is.eq r11[0u32] 0u128 into r82;\n or r82 r81 into r83;\n or r83 r12 into r84;\n assert.eq r84 true;\n pow 10u64 r80 into r85;\n cast r85 into r86 as u128;\n mul r76 r86 into r87;\n gt r1.local_decimals r1.remote_decimals into r88;\n ternary r88 r1.remote_decimals r1.local_decimals into r89;\n sub r1.remote_decimals r89 into r90;\n pow 10u64 r90 into r91;\n serialize.bits.raw r11 ([u128; 2u32]) into r92 ([boolean; 256u32]);\n deserialize.bits.raw r92 ([boolean; 256u32]) into r93 ([u8; 32u32]);\n cast r93[0u32] into r94 as u64;\n shl r94 56u32 into r95;\n add 0u64 r95 into r96;\n cast r93[1u32] into r97 as u64;\n shl r97 48u32 into r98;\n add r96 r98 into r99;\n cast r93[2u32] into r100 as u64;\n shl r100 40u32 into r101;\n add r99 r101 into r102;\n cast r93[3u32] into r103 as u64;\n shl r103 32u32 into r104;\n add r102 r104 into r105;\n cast r93[4u32] into r106 as u64;\n shl r106 24u32 into r107;\n add r105 r107 into r108;\n cast r93[5u32] into r109 as u64;\n shl r109 16u32 into r110;\n add r108 r110 into r111;\n cast r93[6u32] into r112 as u64;\n shl r112 8u32 into r113;\n add r111 r113 into r114;\n cast r93[7u32] into r115 as u64;\n shl r115 0u32 into r116;\n add r114 r116 into r117;\n cast r93[8u32] into r118 as u64;\n shl r118 56u32 into r119;\n add 0u64 r119 into r120;\n cast r93[9u32] into r121 as u64;\n shl r121 48u32 into r122;\n add r120 r122 into r123;\n cast r93[10u32] into r124 as u64;\n shl r124 40u32 into r125;\n add r123 r125 into r126;\n cast r93[11u32] into r127 as u64;\n shl r127 32u32 into r128;\n add r126 r128 into r129;\n cast r93[12u32] into r130 as u64;\n shl r130 24u32 into r131;\n add r129 r131 into r132;\n cast r93[13u32] into r133 as u64;\n shl r133 16u32 into r134;\n add r132 r134 into r135;\n cast r93[14u32] into r136 as u64;\n shl r136 8u32 into r137;\n add r135 r137 into r138;\n cast r93[15u32] into r139 as u64;\n shl r139 0u32 into r140;\n add r138 r140 into r141;\n cast r93[16u32] into r142 as u64;\n shl r142 56u32 into r143;\n add 0u64 r143 into r144;\n cast r93[17u32] into r145 as u64;\n shl r145 48u32 into r146;\n add r144 r146 into r147;\n cast r93[18u32] into r148 as u64;\n shl r148 40u32 into r149;\n add r147 r149 into r150;\n cast r93[19u32] into r151 as u64;\n shl r151 32u32 into r152;\n add r150 r152 into r153;\n cast r93[20u32] into r154 as u64;\n shl r154 24u32 into r155;\n add r153 r155 into r156;\n cast r93[21u32] into r157 as u64;\n shl r157 16u32 into r158;\n add r156 r158 into r159;\n cast r93[22u32] into r160 as u64;\n shl r160 8u32 into r161;\n add r159 r161 into r162;\n cast r93[23u32] into r163 as u64;\n shl r163 0u32 into r164;\n add r162 r164 into r165;\n cast r93[24u32] into r166 as u64;\n shl r166 56u32 into r167;\n add 0u64 r167 into r168;\n cast r93[25u32] into r169 as u64;\n shl r169 48u32 into r170;\n add r168 r170 into r171;\n cast r93[26u32] into r172 as u64;\n shl r172 40u32 into r173;\n add r171 r173 into r174;\n cast r93[27u32] into r175 as u64;\n shl r175 32u32 into r176;\n add r174 r176 into r177;\n cast r93[28u32] into r178 as u64;\n shl r178 24u32 into r179;\n add r177 r179 into r180;\n cast r93[29u32] into r181 as u64;\n shl r181 16u32 into r182;\n add r180 r182 into r183;\n cast r93[30u32] into r184 as u64;\n shl r184 8u32 into r185;\n add r183 r185 into r186;\n cast r93[31u32] into r187 as u64;\n shl r187 0u32 into r188;\n add r186 r188 into r189;\n shl 0u128 64u32 into r190;\n cast r117 into r191 as u128;\n or r190 r191 into r192;\n cast r91 into r193 as u128;\n div r192 r193 into r194;\n cast r194 into r195 as u64;\n cast r91 into r196 as u128;\n rem r192 r196 into r197;\n shl r197 64u32 into r198;\n cast r141 into r199 as u128;\n or r198 r199 into r200;\n cast r91 into r201 as u128;\n div r200 r201 into r202;\n cast r202 into r203 as u64;\n cast r91 into r204 as u128;\n rem r200 r204 into r205;\n shl r205 64u32 into r206;\n cast r165 into r207 as u128;\n or r206 r207 into r208;\n cast r91 into r209 as u128;\n div r208 r209 into r210;\n cast r210 into r211 as u64;\n cast r91 into r212 as u128;\n rem r208 r212 into r213;\n shl r213 64u32 into r214;\n cast r189 into r215 as u128;\n or r214 r215 into r216;\n cast r91 into r217 as u128;\n div r216 r217 into r218;\n cast r218 into r219 as u64;\n cast r91 into r220 as u128;\n rem r216 r220 into r221;\n assert.eq r195 0u64;\n assert.eq r203 0u64;\n cast r211 into r222 as u128;\n shl r222 64u32 into r223;\n cast r219 into r224 as u128;\n or r223 r224 into r225;\n ternary r77 r87 r225 into r226;\n ternary r12 r76 r226 into r227;\n call token_registry.aleo/mint_public r1.token_id r10 r227 4294967295u32 into r228;\n async process r6 r1 r2 r228 r0 into r229;\n output r229 as hyp_synthetic.aleo/process.future;\n\nfinalize process:\n input r0 as mailbox.aleo/process.future;\n input r1 as Metadata.public;\n input r2 as Message.public;\n input r3 as token_registry.aleo/mint_public.future;\n input r4 as address.public;\n get app_metadata[true] into r5;\n assert.eq r5 r1;\n get mailbox.aleo/mailbox[true] into r6;\n is.eq r5.ism aleo1qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq3ljyzc into r7;\n ternary r7 r6.default_ism r5.ism into r8;\n assert.eq r8 r4;\n get remote_routers[r2.origin_domain] into r9;\n assert.eq r9.recipient r2.sender;\n await r0;\n await r3;\n\nfunction get_balance_key:\n input r0 as address.private;\n input r1 as field.private;\n cast r0 r1 into r2 as TokenOwner;\n hash.bhp256 r2 into r3 as field;\n output r3 as field.private;\n\nconstructor:\n assert.eq edition 0u16;\n`;
18
+ const ism_manager = `program ism_manager.aleo;\n\nstruct Message:\n version as u8;\n nonce as u32;\n origin_domain as u32;\n sender as [u8; 32u32];\n destination_domain as u32;\n recipient as [u8; 32u32];\n body as [u128; 16u32];\n\nstruct EthAddress:\n bytes as [u8; 20u32];\n\nstruct MessageIdMultisigIsm:\n validators as [EthAddress; 6u32];\n validator_count as u8;\n threshold as u8;\n nonce as u32;\n\nstruct DomainRoutingIsm:\n ism_owner as address;\n nonce as u32;\n\nstruct NoopIsm:\n nonce as u32;\n\nstruct IsmRouteKey:\n ism as address;\n domain as u32;\n\nstruct RouteIndexKey:\n ism as address;\n index as u32;\n\nmapping nonce:\n key as boolean.public;\n value as u32.public;\n\nmapping ism_addresses:\n key as u32.public;\n value as address.public;\n\nmapping isms:\n key as address.public;\n value as u8.public;\n\nmapping domain_routing_isms:\n key as address.public;\n value as DomainRoutingIsm.public;\n\nmapping routes:\n key as IsmRouteKey.public;\n value as address.public;\n\nmapping route_iter:\n key as RouteIndexKey.public;\n value as IsmRouteKey.public;\n\nmapping route_length:\n key as address.public;\n value as u32.public;\n\nmapping message_id_multisigs:\n key as address.public;\n value as MessageIdMultisigIsm.public;\n\nfunction init_noop:\n async init_noop into r0;\n output r0 as ism_manager.aleo/init_noop.future;\n\nfinalize init_noop:\n get.or_use nonce[true] 0u32 into r0;\n cast r0 into r1 as NoopIsm;\n hash.bhp256 r1 into r2 as address;\n contains isms[r2] into r3;\n not r3 into r4;\n assert.eq r4 true;\n add r0 1u32 into r5;\n set r5 into nonce[true];\n set 6u8 into isms[r2];\n set r2 into ism_addresses[r0];\n\nfunction init_message_id_multisig:\n input r0 as [EthAddress; 6u32].private;\n input r1 as u8.private;\n input r2 as u8.private;\n async init_message_id_multisig r0 r1 r2 into r3;\n output r3 as ism_manager.aleo/init_message_id_multisig.future;\n\nfinalize init_message_id_multisig:\n input r0 as [EthAddress; 6u32].public;\n input r1 as u8.public;\n input r2 as u8.public;\n gt r2 0u8 into r3;\n assert.eq r3 true;\n lte r2 r1 into r4;\n assert.eq r4 true;\n lte r1 6u8 into r5;\n assert.eq r5 true;\n get.or_use nonce[true] 0u32 into r6;\n cast r0 r1 r2 r6 into r7 as MessageIdMultisigIsm;\n hash.bhp256 r7 into r8 as address;\n contains message_id_multisigs[r8] into r9;\n not r9 into r10;\n assert.eq r10 true;\n set r7 into message_id_multisigs[r8];\n add r6 1u32 into r11;\n set r11 into nonce[true];\n set 5u8 into isms[r8];\n set r8 into ism_addresses[r6];\n\nfunction init_domain_routing:\n async init_domain_routing self.caller into r0;\n output r0 as ism_manager.aleo/init_domain_routing.future;\n\nfinalize init_domain_routing:\n input r0 as address.public;\n get.or_use nonce[true] 0u32 into r1;\n cast r0 r1 into r2 as DomainRoutingIsm;\n hash.bhp256 r2 into r3 as address;\n contains domain_routing_isms[r3] into r4;\n not r4 into r5;\n assert.eq r5 true;\n set r2 into domain_routing_isms[r3];\n add r1 1u32 into r6;\n set r6 into nonce[true];\n set 1u8 into isms[r3];\n set r3 into ism_addresses[r1];\n\nfunction set_domain:\n input r0 as address.private;\n input r1 as u32.private;\n input r2 as address.private;\n async set_domain r0 r1 r2 self.caller into r3;\n output r3 as ism_manager.aleo/set_domain.future;\n\nfinalize set_domain:\n input r0 as address.public;\n input r1 as u32.public;\n input r2 as address.public;\n input r3 as address.public;\n contains domain_routing_isms[r0] into r4;\n assert.eq r4 true;\n get domain_routing_isms[r0] into r5;\n assert.eq r5.ism_owner r3;\n cast r0 r1 into r6 as IsmRouteKey;\n contains routes[r6] into r7;\n not r7 into r8;\n branch.eq r8 false to end_then_0_0;\n get.or_use route_length[r0] 0u32 into r9;\n cast r0 r9 into r10 as RouteIndexKey;\n set r6 into route_iter[r10];\n add r9 1u32 into r11;\n set r11 into route_length[r0];\n branch.eq true true to end_otherwise_0_1;\n position end_then_0_0;\n position end_otherwise_0_1;\n set r2 into routes[r6];\n\nfunction remove_domain:\n input r0 as address.private;\n input r1 as u32.private;\n async remove_domain r0 r1 self.caller into r2;\n output r2 as ism_manager.aleo/remove_domain.future;\n\nfinalize remove_domain:\n input r0 as address.public;\n input r1 as u32.public;\n input r2 as address.public;\n contains domain_routing_isms[r0] into r3;\n assert.eq r3 true;\n get domain_routing_isms[r0] into r4;\n assert.eq r4.ism_owner r2;\n cast r0 r1 into r5 as IsmRouteKey;\n remove routes[r5];\n\nfunction transfer_routing_ism_ownership:\n input r0 as address.private;\n input r1 as address.private;\n async transfer_routing_ism_ownership r0 self.caller r1 into r2;\n output r2 as ism_manager.aleo/transfer_routing_ism_ownership.future;\n\nfinalize transfer_routing_ism_ownership:\n input r0 as address.public;\n input r1 as address.public;\n input r2 as address.public;\n contains domain_routing_isms[r0] into r3;\n assert.eq r3 true;\n get domain_routing_isms[r0] into r4;\n assert.eq r4.ism_owner r1;\n cast r2 r4.nonce into r5 as DomainRoutingIsm;\n set r5 into domain_routing_isms[r0];\n\nfunction verify:\n input r0 as address.public;\n input r1 as Message.public;\n input r2 as [u128; 2u32].public;\n input r3 as [u8; 512u32].public;\n async verify r0 r1 r2 r3 into r4;\n output r4 as ism_manager.aleo/verify.future;\n\nfinalize verify:\n input r0 as address.public;\n input r1 as Message.public;\n input r2 as [u128; 2u32].public;\n input r3 as [u8; 512u32].public;\n cast r3[68u32] r3[69u32] r3[70u32] r3[71u32] r3[72u32] r3[73u32] r3[74u32] r3[75u32] r3[76u32] r3[77u32] r3[78u32] r3[79u32] r3[80u32] r3[81u32] r3[82u32] r3[83u32] r3[84u32] r3[85u32] r3[86u32] r3[87u32] r3[88u32] r3[89u32] r3[90u32] r3[91u32] r3[92u32] r3[93u32] r3[94u32] r3[95u32] r3[96u32] r3[97u32] r3[98u32] r3[99u32] r3[100u32] r3[101u32] r3[102u32] r3[103u32] r3[104u32] r3[105u32] r3[106u32] r3[107u32] r3[108u32] r3[109u32] r3[110u32] r3[111u32] r3[112u32] r3[113u32] r3[114u32] r3[115u32] r3[116u32] r3[117u32] r3[118u32] r3[119u32] r3[120u32] r3[121u32] r3[122u32] r3[123u32] r3[124u32] r3[125u32] r3[126u32] r3[127u32] r3[128u32] r3[129u32] r3[130u32] r3[131u32] r3[132u32] into r4 as [u8; 65u32];\n cast r3[133u32] r3[134u32] r3[135u32] r3[136u32] r3[137u32] r3[138u32] r3[139u32] r3[140u32] r3[141u32] r3[142u32] r3[143u32] r3[144u32] r3[145u32] r3[146u32] r3[147u32] r3[148u32] r3[149u32] r3[150u32] r3[151u32] r3[152u32] r3[153u32] r3[154u32] r3[155u32] r3[156u32] r3[157u32] r3[158u32] r3[159u32] r3[160u32] r3[161u32] r3[162u32] r3[163u32] r3[164u32] r3[165u32] r3[166u32] r3[167u32] r3[168u32] r3[169u32] r3[170u32] r3[171u32] r3[172u32] r3[173u32] r3[174u32] r3[175u32] r3[176u32] r3[177u32] r3[178u32] r3[179u32] r3[180u32] r3[181u32] r3[182u32] r3[183u32] r3[184u32] r3[185u32] r3[186u32] r3[187u32] r3[188u32] r3[189u32] r3[190u32] r3[191u32] r3[192u32] r3[193u32] r3[194u32] r3[195u32] r3[196u32] r3[197u32] into r5 as [u8; 65u32];\n cast r3[198u32] r3[199u32] r3[200u32] r3[201u32] r3[202u32] r3[203u32] r3[204u32] r3[205u32] r3[206u32] r3[207u32] r3[208u32] r3[209u32] r3[210u32] r3[211u32] r3[212u32] r3[213u32] r3[214u32] r3[215u32] r3[216u32] r3[217u32] r3[218u32] r3[219u32] r3[220u32] r3[221u32] r3[222u32] r3[223u32] r3[224u32] r3[225u32] r3[226u32] r3[227u32] r3[228u32] r3[229u32] r3[230u32] r3[231u32] r3[232u32] r3[233u32] r3[234u32] r3[235u32] r3[236u32] r3[237u32] r3[238u32] r3[239u32] r3[240u32] r3[241u32] r3[242u32] r3[243u32] r3[244u32] r3[245u32] r3[246u32] r3[247u32] r3[248u32] r3[249u32] r3[250u32] r3[251u32] r3[252u32] r3[253u32] r3[254u32] r3[255u32] r3[256u32] r3[257u32] r3[258u32] r3[259u32] r3[260u32] r3[261u32] r3[262u32] into r6 as [u8; 65u32];\n cast r3[263u32] r3[264u32] r3[265u32] r3[266u32] r3[267u32] r3[268u32] r3[269u32] r3[270u32] r3[271u32] r3[272u32] r3[273u32] r3[274u32] r3[275u32] r3[276u32] r3[277u32] r3[278u32] r3[279u32] r3[280u32] r3[281u32] r3[282u32] r3[283u32] r3[284u32] r3[285u32] r3[286u32] r3[287u32] r3[288u32] r3[289u32] r3[290u32] r3[291u32] r3[292u32] r3[293u32] r3[294u32] r3[295u32] r3[296u32] r3[297u32] r3[298u32] r3[299u32] r3[300u32] r3[301u32] r3[302u32] r3[303u32] r3[304u32] r3[305u32] r3[306u32] r3[307u32] r3[308u32] r3[309u32] r3[310u32] r3[311u32] r3[312u32] r3[313u32] r3[314u32] r3[315u32] r3[316u32] r3[317u32] r3[318u32] r3[319u32] r3[320u32] r3[321u32] r3[322u32] r3[323u32] r3[324u32] r3[325u32] r3[326u32] r3[327u32] into r7 as [u8; 65u32];\n cast r3[328u32] r3[329u32] r3[330u32] r3[331u32] r3[332u32] r3[333u32] r3[334u32] r3[335u32] r3[336u32] r3[337u32] r3[338u32] r3[339u32] r3[340u32] r3[341u32] r3[342u32] r3[343u32] r3[344u32] r3[345u32] r3[346u32] r3[347u32] r3[348u32] r3[349u32] r3[350u32] r3[351u32] r3[352u32] r3[353u32] r3[354u32] r3[355u32] r3[356u32] r3[357u32] r3[358u32] r3[359u32] r3[360u32] r3[361u32] r3[362u32] r3[363u32] r3[364u32] r3[365u32] r3[366u32] r3[367u32] r3[368u32] r3[369u32] r3[370u32] r3[371u32] r3[372u32] r3[373u32] r3[374u32] r3[375u32] r3[376u32] r3[377u32] r3[378u32] r3[379u32] r3[380u32] r3[381u32] r3[382u32] r3[383u32] r3[384u32] r3[385u32] r3[386u32] r3[387u32] r3[388u32] r3[389u32] r3[390u32] r3[391u32] r3[392u32] into r8 as [u8; 65u32];\n cast r3[393u32] r3[394u32] r3[395u32] r3[396u32] r3[397u32] r3[398u32] r3[399u32] r3[400u32] r3[401u32] r3[402u32] r3[403u32] r3[404u32] r3[405u32] r3[406u32] r3[407u32] r3[408u32] r3[409u32] r3[410u32] r3[411u32] r3[412u32] r3[413u32] r3[414u32] r3[415u32] r3[416u32] r3[417u32] r3[418u32] r3[419u32] r3[420u32] r3[421u32] r3[422u32] r3[423u32] r3[424u32] r3[425u32] r3[426u32] r3[427u32] r3[428u32] r3[429u32] r3[430u32] r3[431u32] r3[432u32] r3[433u32] r3[434u32] r3[435u32] r3[436u32] r3[437u32] r3[438u32] r3[439u32] r3[440u32] r3[441u32] r3[442u32] r3[443u32] r3[444u32] r3[445u32] r3[446u32] r3[447u32] r3[448u32] r3[449u32] r3[450u32] r3[451u32] r3[452u32] r3[453u32] r3[454u32] r3[455u32] r3[456u32] r3[457u32] into r9 as [u8; 65u32];\n cast r4 r5 r6 r7 r8 r9 into r10 as [[u8; 65u32]; 6u32];\n cast r3[0u32] r3[1u32] r3[2u32] r3[3u32] r3[4u32] r3[5u32] r3[6u32] r3[7u32] r3[8u32] r3[9u32] r3[10u32] r3[11u32] r3[12u32] r3[13u32] r3[14u32] r3[15u32] r3[16u32] r3[17u32] r3[18u32] r3[19u32] r3[20u32] r3[21u32] r3[22u32] r3[23u32] r3[24u32] r3[25u32] r3[26u32] r3[27u32] r3[28u32] r3[29u32] r3[30u32] r3[31u32] into r11 as [u8; 32u32];\n shr r1.origin_domain 24u32 into r12;\n cast r12 into r13 as u8;\n shr r1.origin_domain 16u32 into r14;\n rem r14 256u32 into r15;\n cast r15 into r16 as u8;\n shr r1.origin_domain 8u32 into r17;\n rem r17 256u32 into r18;\n cast r18 into r19 as u8;\n rem r1.origin_domain 256u32 into r20;\n cast r20 into r21 as u8;\n cast r13 r16 r19 r21 r11[0u32] r11[1u32] r11[2u32] r11[3u32] r11[4u32] r11[5u32] r11[6u32] r11[7u32] r11[8u32] r11[9u32] r11[10u32] r11[11u32] r11[12u32] r11[13u32] r11[14u32] r11[15u32] r11[16u32] r11[17u32] r11[18u32] r11[19u32] r11[20u32] r11[21u32] r11[22u32] r11[23u32] r11[24u32] r11[25u32] r11[26u32] r11[27u32] r11[28u32] r11[29u32] r11[30u32] r11[31u32] 72u8 89u8 80u8 69u8 82u8 76u8 65u8 78u8 69u8 into r22 as [u8; 45u32];\n hash.keccak256.native.raw r22 into r23 as [boolean; 256u32];\n deserialize.bits.raw r23 ([boolean; 256u32]) into r24 ([u8; 32u32]);\n serialize.bits.raw r2[0u32] (u128) into r25 ([boolean; 128u32]);\n serialize.bits.raw r2[1u32] (u128) into r26 ([boolean; 128u32]);\n cast r25[0u32] r25[1u32] r25[2u32] r25[3u32] r25[4u32] r25[5u32] r25[6u32] r25[7u32] r25[8u32] r25[9u32] r25[10u32] r25[11u32] r25[12u32] r25[13u32] r25[14u32] r25[15u32] r25[16u32] r25[17u32] r25[18u32] r25[19u32] r25[20u32] r25[21u32] r25[22u32] r25[23u32] r25[24u32] r25[25u32] r25[26u32] r25[27u32] r25[28u32] r25[29u32] r25[30u32] r25[31u32] r25[32u32] r25[33u32] r25[34u32] r25[35u32] r25[36u32] r25[37u32] r25[38u32] r25[39u32] r25[40u32] r25[41u32] r25[42u32] r25[43u32] r25[44u32] r25[45u32] r25[46u32] r25[47u32] r25[48u32] r25[49u32] r25[50u32] r25[51u32] r25[52u32] r25[53u32] r25[54u32] r25[55u32] r25[56u32] r25[57u32] r25[58u32] r25[59u32] r25[60u32] r25[61u32] r25[62u32] r25[63u32] r25[64u32] r25[65u32] r25[66u32] r25[67u32] r25[68u32] r25[69u32] r25[70u32] r25[71u32] r25[72u32] r25[73u32] r25[74u32] r25[75u32] r25[76u32] r25[77u32] r25[78u32] r25[79u32] r25[80u32] r25[81u32] r25[82u32] r25[83u32] r25[84u32] r25[85u32] r25[86u32] r25[87u32] r25[88u32] r25[89u32] r25[90u32] r25[91u32] r25[92u32] r25[93u32] r25[94u32] r25[95u32] r25[96u32] r25[97u32] r25[98u32] r25[99u32] r25[100u32] r25[101u32] r25[102u32] r25[103u32] r25[104u32] r25[105u32] r25[106u32] r25[107u32] r25[108u32] r25[109u32] r25[110u32] r25[111u32] r25[112u32] r25[113u32] r25[114u32] r25[115u32] r25[116u32] r25[117u32] r25[118u32] r25[119u32] r25[120u32] r25[121u32] r25[122u32] r25[123u32] r25[124u32] r25[125u32] r25[126u32] r25[127u32] r26[0u32] r26[1u32] r26[2u32] r26[3u32] r26[4u32] r26[5u32] r26[6u32] r26[7u32] r26[8u32] r26[9u32] r26[10u32] r26[11u32] r26[12u32] r26[13u32] r26[14u32] r26[15u32] r26[16u32] r26[17u32] r26[18u32] r26[19u32] r26[20u32] r26[21u32] r26[22u32] r26[23u32] r26[24u32] r26[25u32] r26[26u32] r26[27u32] r26[28u32] r26[29u32] r26[30u32] r26[31u32] r26[32u32] r26[33u32] r26[34u32] r26[35u32] r26[36u32] r26[37u32] r26[38u32] r26[39u32] r26[40u32] r26[41u32] r26[42u32] r26[43u32] r26[44u32] r26[45u32] r26[46u32] r26[47u32] r26[48u32] r26[49u32] r26[50u32] r26[51u32] r26[52u32] r26[53u32] r26[54u32] r26[55u32] r26[56u32] r26[57u32] r26[58u32] r26[59u32] r26[60u32] r26[61u32] r26[62u32] r26[63u32] r26[64u32] r26[65u32] r26[66u32] r26[67u32] r26[68u32] r26[69u32] r26[70u32] r26[71u32] r26[72u32] r26[73u32] r26[74u32] r26[75u32] r26[76u32] r26[77u32] r26[78u32] r26[79u32] r26[80u32] r26[81u32] r26[82u32] r26[83u32] r26[84u32] r26[85u32] r26[86u32] r26[87u32] r26[88u32] r26[89u32] r26[90u32] r26[91u32] r26[92u32] r26[93u32] r26[94u32] r26[95u32] r26[96u32] r26[97u32] r26[98u32] r26[99u32] r26[100u32] r26[101u32] r26[102u32] r26[103u32] r26[104u32] r26[105u32] r26[106u32] r26[107u32] r26[108u32] r26[109u32] r26[110u32] r26[111u32] r26[112u32] r26[113u32] r26[114u32] r26[115u32] r26[116u32] r26[117u32] r26[118u32] r26[119u32] r26[120u32] r26[121u32] r26[122u32] r26[123u32] r26[124u32] r26[125u32] r26[126u32] r26[127u32] into r27 as [boolean; 256u32];\n deserialize.bits.raw r27 ([boolean; 256u32]) into r28 ([u8; 32u32]);\n cast r24[0u32] r24[1u32] r24[2u32] r24[3u32] r24[4u32] r24[5u32] r24[6u32] r24[7u32] r24[8u32] r24[9u32] r24[10u32] r24[11u32] r24[12u32] r24[13u32] r24[14u32] r24[15u32] r24[16u32] r24[17u32] r24[18u32] r24[19u32] r24[20u32] r24[21u32] r24[22u32] r24[23u32] r24[24u32] r24[25u32] r24[26u32] r24[27u32] r24[28u32] r24[29u32] r24[30u32] r24[31u32] r3[32u32] r3[33u32] r3[34u32] r3[35u32] r3[36u32] r3[37u32] r3[38u32] r3[39u32] r3[40u32] r3[41u32] r3[42u32] r3[43u32] r3[44u32] r3[45u32] r3[46u32] r3[47u32] r3[48u32] r3[49u32] r3[50u32] r3[51u32] r3[52u32] r3[53u32] r3[54u32] r3[55u32] r3[56u32] r3[57u32] r3[58u32] r3[59u32] r3[60u32] r3[61u32] r3[62u32] r3[63u32] r3[64u32] r3[65u32] r3[66u32] r3[67u32] r28[0u32] r28[1u32] r28[2u32] r28[3u32] r28[4u32] r28[5u32] r28[6u32] r28[7u32] r28[8u32] r28[9u32] r28[10u32] r28[11u32] r28[12u32] r28[13u32] r28[14u32] r28[15u32] r28[16u32] r28[17u32] r28[18u32] r28[19u32] r28[20u32] r28[21u32] r28[22u32] r28[23u32] r28[24u32] r28[25u32] r28[26u32] r28[27u32] r28[28u32] r28[29u32] r28[30u32] r28[31u32] into r29 as [u8; 100u32];\n hash.keccak256.native.raw r29 into r30 as [boolean; 256u32];\n deserialize.bits.raw r30 ([boolean; 256u32]) into r31 ([u8; 32u32]);\n cast 25u8 69u8 116u8 104u8 101u8 114u8 101u8 117u8 109u8 32u8 83u8 105u8 103u8 110u8 101u8 100u8 32u8 77u8 101u8 115u8 115u8 97u8 103u8 101u8 58u8 10u8 51u8 50u8 r31[0u32] r31[1u32] r31[2u32] r31[3u32] r31[4u32] r31[5u32] r31[6u32] r31[7u32] r31[8u32] r31[9u32] r31[10u32] r31[11u32] r31[12u32] r31[13u32] r31[14u32] r31[15u32] r31[16u32] r31[17u32] r31[18u32] r31[19u32] r31[20u32] r31[21u32] r31[22u32] r31[23u32] r31[24u32] r31[25u32] r31[26u32] r31[27u32] r31[28u32] r31[29u32] r31[30u32] r31[31u32] into r32 as [u8; 60u32];\n hash.keccak256.native.raw r32 into r33 as [boolean; 256u32];\n deserialize.bits.raw r33 ([boolean; 256u32]) into r34 ([u8; 32u32]);\n get isms[r0] into r35;\n contains isms[r0] into r36;\n assert.eq r36 true;\n is.eq r35 5u8 into r37;\n branch.eq r37 false to end_then_0_2;\n get message_id_multisigs[r0] into r38;\n ecdsa.verify.digest.eth r10[0u32] r38.validators[0u32].bytes r34 into r39;\n ternary r39 1u8 0u8 into r40;\n add 0u8 r40 into r41;\n ecdsa.verify.digest.eth r10[1u32] r38.validators[1u32].bytes r34 into r42;\n ternary r42 1u8 0u8 into r43;\n add r41 r43 into r44;\n ecdsa.verify.digest.eth r10[2u32] r38.validators[2u32].bytes r34 into r45;\n ternary r45 1u8 0u8 into r46;\n add r44 r46 into r47;\n ecdsa.verify.digest.eth r10[3u32] r38.validators[3u32].bytes r34 into r48;\n ternary r48 1u8 0u8 into r49;\n add r47 r49 into r50;\n ecdsa.verify.digest.eth r10[4u32] r38.validators[4u32].bytes r34 into r51;\n ternary r51 1u8 0u8 into r52;\n add r50 r52 into r53;\n ecdsa.verify.digest.eth r10[5u32] r38.validators[5u32].bytes r34 into r54;\n ternary r54 1u8 0u8 into r55;\n add r53 r55 into r56;\n gte r56 r38.threshold into r57;\n assert.eq r57 true;\n branch.eq true true to end_otherwise_0_3;\n position end_then_0_2;\n is.eq r35 6u8 into r58;\n is.eq r35 1u8 into r59;\n or r58 r59 into r60;\n branch.eq r60 false to end_then_1_4;\n branch.eq true true to end_otherwise_1_5;\n position end_then_1_4;\n assert.eq false true;\n position end_otherwise_1_5;\n position end_otherwise_0_3;\n cast r0 r1.origin_domain into r61 as IsmRouteKey;\n get.or_use routes[r61] r0 into r62;\n get isms[r62] into r63;\n contains isms[r62] into r64;\n assert.eq r64 true;\n is.eq r63 5u8 into r65;\n branch.eq r65 false to end_then_0_6;\n get message_id_multisigs[r62] into r66;\n ecdsa.verify.digest.eth r10[0u32] r66.validators[0u32].bytes r34 into r67;\n ternary r67 1u8 0u8 into r68;\n add 0u8 r68 into r69;\n ecdsa.verify.digest.eth r10[1u32] r66.validators[1u32].bytes r34 into r70;\n ternary r70 1u8 0u8 into r71;\n add r69 r71 into r72;\n ecdsa.verify.digest.eth r10[2u32] r66.validators[2u32].bytes r34 into r73;\n ternary r73 1u8 0u8 into r74;\n add r72 r74 into r75;\n ecdsa.verify.digest.eth r10[3u32] r66.validators[3u32].bytes r34 into r76;\n ternary r76 1u8 0u8 into r77;\n add r75 r77 into r78;\n ecdsa.verify.digest.eth r10[4u32] r66.validators[4u32].bytes r34 into r79;\n ternary r79 1u8 0u8 into r80;\n add r78 r80 into r81;\n ecdsa.verify.digest.eth r10[5u32] r66.validators[5u32].bytes r34 into r82;\n ternary r82 1u8 0u8 into r83;\n add r81 r83 into r84;\n gte r84 r66.threshold into r85;\n assert.eq r85 true;\n branch.eq true true to end_otherwise_0_7;\n position end_then_0_6;\n is.eq r63 6u8 into r86;\n is.eq r63 1u8 into r87;\n or r86 r87 into r88;\n branch.eq r88 false to end_then_1_8;\n branch.eq true true to end_otherwise_1_9;\n position end_then_1_8;\n assert.eq false true;\n position end_otherwise_1_9;\n position end_otherwise_0_7;\n cast r62 r1.origin_domain into r89 as IsmRouteKey;\n get.or_use routes[r89] r62 into r90;\n get isms[r90] into r91;\n contains isms[r90] into r92;\n assert.eq r92 true;\n is.eq r91 5u8 into r93;\n branch.eq r93 false to end_then_0_10;\n get message_id_multisigs[r90] into r94;\n ecdsa.verify.digest.eth r10[0u32] r94.validators[0u32].bytes r34 into r95;\n ternary r95 1u8 0u8 into r96;\n add 0u8 r96 into r97;\n ecdsa.verify.digest.eth r10[1u32] r94.validators[1u32].bytes r34 into r98;\n ternary r98 1u8 0u8 into r99;\n add r97 r99 into r100;\n ecdsa.verify.digest.eth r10[2u32] r94.validators[2u32].bytes r34 into r101;\n ternary r101 1u8 0u8 into r102;\n add r100 r102 into r103;\n ecdsa.verify.digest.eth r10[3u32] r94.validators[3u32].bytes r34 into r104;\n ternary r104 1u8 0u8 into r105;\n add r103 r105 into r106;\n ecdsa.verify.digest.eth r10[4u32] r94.validators[4u32].bytes r34 into r107;\n ternary r107 1u8 0u8 into r108;\n add r106 r108 into r109;\n ecdsa.verify.digest.eth r10[5u32] r94.validators[5u32].bytes r34 into r110;\n ternary r110 1u8 0u8 into r111;\n add r109 r111 into r112;\n gte r112 r94.threshold into r113;\n assert.eq r113 true;\n branch.eq true true to end_otherwise_0_11;\n position end_then_0_10;\n is.eq r91 6u8 into r114;\n is.eq r91 1u8 into r115;\n or r114 r115 into r116;\n branch.eq r116 false to end_then_1_12;\n branch.eq true true to end_otherwise_1_13;\n position end_then_1_12;\n assert.eq false true;\n position end_otherwise_1_13;\n position end_otherwise_0_11;\n cast r90 r1.origin_domain into r117 as IsmRouteKey;\n get.or_use routes[r117] r90 into r118;\n get isms[r118] into r119;\n contains isms[r118] into r120;\n assert.eq r120 true;\n is.eq r119 5u8 into r121;\n branch.eq r121 false to end_then_0_14;\n get message_id_multisigs[r118] into r122;\n ecdsa.verify.digest.eth r10[0u32] r122.validators[0u32].bytes r34 into r123;\n ternary r123 1u8 0u8 into r124;\n add 0u8 r124 into r125;\n ecdsa.verify.digest.eth r10[1u32] r122.validators[1u32].bytes r34 into r126;\n ternary r126 1u8 0u8 into r127;\n add r125 r127 into r128;\n ecdsa.verify.digest.eth r10[2u32] r122.validators[2u32].bytes r34 into r129;\n ternary r129 1u8 0u8 into r130;\n add r128 r130 into r131;\n ecdsa.verify.digest.eth r10[3u32] r122.validators[3u32].bytes r34 into r132;\n ternary r132 1u8 0u8 into r133;\n add r131 r133 into r134;\n ecdsa.verify.digest.eth r10[4u32] r122.validators[4u32].bytes r34 into r135;\n ternary r135 1u8 0u8 into r136;\n add r134 r136 into r137;\n ecdsa.verify.digest.eth r10[5u32] r122.validators[5u32].bytes r34 into r138;\n ternary r138 1u8 0u8 into r139;\n add r137 r139 into r140;\n gte r140 r122.threshold into r141;\n assert.eq r141 true;\n branch.eq true true to end_otherwise_0_15;\n position end_then_0_14;\n is.eq r119 6u8 into r142;\n is.eq r119 1u8 into r143;\n or r142 r143 into r144;\n branch.eq r144 false to end_then_1_16;\n branch.eq true true to end_otherwise_1_17;\n position end_then_1_16;\n assert.eq false true;\n position end_otherwise_1_17;\n position end_otherwise_0_15;\n cast r118 r1.origin_domain into r145 as IsmRouteKey;\n get.or_use routes[r145] r118 into r146;\n get isms[r146] into r147;\n is.eq r147 1u8 into r148;\n branch.eq r148 false to end_then_0_18;\n assert.eq false true;\n branch.eq true true to end_otherwise_0_19;\n position end_then_0_18;\n position end_otherwise_0_19;\n\nconstructor:\n assert.eq edition 0u16;\n`;
19
+ const mailbox = `import ism_manager.aleo;\nprogram mailbox.aleo;\n\nstruct Mailbox:\n local_domain as u32;\n nonce as u32;\n process_count as u32;\n default_ism as address;\n default_hook as address;\n required_hook as address;\n dispatch_proxy as address;\n mailbox_owner as address;\n\nstruct Message:\n version as u8;\n nonce as u32;\n origin_domain as u32;\n sender as [u8; 32u32];\n destination_domain as u32;\n recipient as [u8; 32u32];\n body as [u128; 16u32];\n\nstruct Delivery:\n processor as address;\n block_number as u32;\n\nstruct DeliveryKey:\n id as [u128; 2u32];\n\nstruct EthAddress:\n bytes as [u8; 20u32];\n\nmapping deliveries:\n key as DeliveryKey.public;\n value as Delivery.public;\n\nmapping dispatch_events:\n key as u32.public;\n value as Message.public;\n\nmapping dispatch_id_events:\n key as u32.public;\n value as [u128; 2u32].public;\n\nmapping process_events:\n key as u32.public;\n value as [u128; 2u32].public;\n\nmapping mailbox:\n key as boolean.public;\n value as Mailbox.public;\n\nmapping process_event_index:\n key as u32.public;\n value as u32.public;\n\nmapping dispatch_event_index:\n key as u32.public;\n value as u32.public;\n\nmapping registered_applications:\n key as address.public;\n value as [u8; 128u32].public;\n\nfunction init:\n input r0 as u32.private;\n async init r0 self.caller into r1;\n output r1 as mailbox.aleo/init.future;\n\nfinalize init:\n input r0 as u32.public;\n input r1 as address.public;\n contains mailbox[true] into r2;\n not r2 into r3;\n assert.eq r3 true;\n cast r0 0u32 0u32 aleo1qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq3ljyzc aleo1qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq3ljyzc aleo1qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq3ljyzc aleo1qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq3ljyzc r1 into r4 as Mailbox;\n set r4 into mailbox[true];\n\nfunction get_address:\n output mailbox.aleo as address.private;\n\nfunction set_dispatch_proxy:\n input r0 as address.private;\n async set_dispatch_proxy self.caller r0 into r1;\n output r1 as mailbox.aleo/set_dispatch_proxy.future;\n\nfinalize set_dispatch_proxy:\n input r0 as address.public;\n input r1 as address.public;\n get mailbox[true] into r2;\n assert.eq r2.mailbox_owner r0;\n cast r2.local_domain r2.nonce r2.process_count r2.default_ism r2.default_hook r2.required_hook r1 r2.mailbox_owner into r3 as Mailbox;\n set r3 into mailbox[true];\n\nfunction set_owner:\n input r0 as address.private;\n async set_owner self.caller r0 into r1;\n output r1 as mailbox.aleo/set_owner.future;\n\nfinalize set_owner:\n input r0 as address.public;\n input r1 as address.public;\n get mailbox[true] into r2;\n assert.eq r2.mailbox_owner r0;\n cast r2.local_domain r2.nonce r2.process_count r2.default_ism r2.default_hook r2.required_hook r2.dispatch_proxy r1 into r3 as Mailbox;\n set r3 into mailbox[true];\n\nfunction set_default_ism:\n input r0 as address.private;\n async set_default_ism self.caller r0 into r1;\n output r1 as mailbox.aleo/set_default_ism.future;\n\nfinalize set_default_ism:\n input r0 as address.public;\n input r1 as address.public;\n get mailbox[true] into r2;\n assert.eq r2.mailbox_owner r0;\n cast r2.local_domain r2.nonce r2.process_count r1 r2.default_hook r2.required_hook r2.dispatch_proxy r2.mailbox_owner into r3 as Mailbox;\n set r3 into mailbox[true];\n\nfunction set_default_hook:\n input r0 as address.private;\n async set_default_hook self.caller r0 into r1;\n output r1 as mailbox.aleo/set_default_hook.future;\n\nfinalize set_default_hook:\n input r0 as address.public;\n input r1 as address.public;\n get mailbox[true] into r2;\n assert.eq r2.mailbox_owner r0;\n cast r2.local_domain r2.nonce r2.process_count r2.default_ism r1 r2.required_hook r2.dispatch_proxy r2.mailbox_owner into r3 as Mailbox;\n set r3 into mailbox[true];\n\nfunction set_required_hook:\n input r0 as address.private;\n async set_required_hook self.caller r0 into r1;\n output r1 as mailbox.aleo/set_required_hook.future;\n\nfinalize set_required_hook:\n input r0 as address.public;\n input r1 as address.public;\n get mailbox[true] into r2;\n assert.eq r2.mailbox_owner r0;\n cast r2.local_domain r2.nonce r2.process_count r2.default_ism r2.default_hook r1 r2.dispatch_proxy r2.mailbox_owner into r3 as Mailbox;\n set r3 into mailbox[true];\n\nfunction register_application:\n input r0 as [u8; 128u32].private;\n async register_application r0 self.caller into r1;\n output r1 as mailbox.aleo/register_application.future;\n\nfinalize register_application:\n input r0 as [u8; 128u32].public;\n input r1 as address.public;\n contains mailbox[true] into r2;\n assert.eq r2 true;\n contains registered_applications[r1] into r3;\n not r3 into r4;\n assert.eq r4 true;\n set r0 into registered_applications[r1];\n\nfunction process:\n input r0 as address.public;\n input r1 as Message.public;\n input r2 as u32.public;\n input r3 as [u128; 2u32].public;\n input r4 as [u8; 512u32].public;\n call ism_manager.aleo/verify r0 r1 r3 r4 into r5;\n async process r0 r1 r2 r3 self.caller r5 into r6;\n output r6 as mailbox.aleo/process.future;\n\nfinalize process:\n input r0 as address.public;\n input r1 as Message.public;\n input r2 as u32.public;\n input r3 as [u128; 2u32].public;\n input r4 as address.public;\n input r5 as ism_manager.aleo/verify.future;\n contains mailbox[true] into r6;\n assert.eq r6 true;\n gte r2 77u32 into r7;\n lte r2 333u32 into r8;\n and r7 r8 into r9;\n assert.eq r9 true;\n sub r2 77u32 into r10;\n rem r10 16u32 into r11;\n is.eq r11 0u32 into r12;\n is.eq r2 206u32 into r13;\n or r12 r13 into r14;\n is.eq r2 149u32 into r15;\n or r14 r15 into r16;\n is.eq r2 167u32 into r17;\n or r16 r17 into r18;\n assert.eq r18 true;\n cast 0u128 0u128 into r19 as [u128; 2u32];\n shr r1.nonce 24u32 into r20;\n cast r20 into r21 as u8;\n shr r1.nonce 16u32 into r22;\n rem r22 256u32 into r23;\n cast r23 into r24 as u8;\n shr r1.nonce 8u32 into r25;\n rem r25 256u32 into r26;\n cast r26 into r27 as u8;\n rem r1.nonce 256u32 into r28;\n cast r28 into r29 as u8;\n cast r21 r24 r27 r29 into r30 as [u8; 4u32];\n shr r1.origin_domain 24u32 into r31;\n cast r31 into r32 as u8;\n shr r1.origin_domain 16u32 into r33;\n rem r33 256u32 into r34;\n cast r34 into r35 as u8;\n shr r1.origin_domain 8u32 into r36;\n rem r36 256u32 into r37;\n cast r37 into r38 as u8;\n rem r1.origin_domain 256u32 into r39;\n cast r39 into r40 as u8;\n cast r32 r35 r38 r40 into r41 as [u8; 4u32];\n shr r1.destination_domain 24u32 into r42;\n cast r42 into r43 as u8;\n shr r1.destination_domain 16u32 into r44;\n rem r44 256u32 into r45;\n cast r45 into r46 as u8;\n shr r1.destination_domain 8u32 into r47;\n rem r47 256u32 into r48;\n cast r48 into r49 as u8;\n rem r1.destination_domain 256u32 into r50;\n cast r50 into r51 as u8;\n cast r43 r46 r49 r51 into r52 as [u8; 4u32];\n serialize.bits.raw r1.body[0u32] (u128) into r53 ([boolean; 128u32]);\n deserialize.bits.raw r53 ([boolean; 128u32]) into r54 ([u8; 16u32]);\n serialize.bits.raw r1.body[1u32] (u128) into r55 ([boolean; 128u32]);\n deserialize.bits.raw r55 ([boolean; 128u32]) into r56 ([u8; 16u32]);\n serialize.bits.raw r1.body[2u32] (u128) into r57 ([boolean; 128u32]);\n deserialize.bits.raw r57 ([boolean; 128u32]) into r58 ([u8; 16u32]);\n serialize.bits.raw r1.body[3u32] (u128) into r59 ([boolean; 128u32]);\n deserialize.bits.raw r59 ([boolean; 128u32]) into r60 ([u8; 16u32]);\n serialize.bits.raw r1.body[4u32] (u128) into r61 ([boolean; 128u32]);\n deserialize.bits.raw r61 ([boolean; 128u32]) into r62 ([u8; 16u32]);\n serialize.bits.raw r1.body[5u32] (u128) into r63 ([boolean; 128u32]);\n deserialize.bits.raw r63 ([boolean; 128u32]) into r64 ([u8; 16u32]);\n serialize.bits.raw r1.body[6u32] (u128) into r65 ([boolean; 128u32]);\n deserialize.bits.raw r65 ([boolean; 128u32]) into r66 ([u8; 16u32]);\n serialize.bits.raw r1.body[7u32] (u128) into r67 ([boolean; 128u32]);\n deserialize.bits.raw r67 ([boolean; 128u32]) into r68 ([u8; 16u32]);\n serialize.bits.raw r1.body[8u32] (u128) into r69 ([boolean; 128u32]);\n deserialize.bits.raw r69 ([boolean; 128u32]) into r70 ([u8; 16u32]);\n serialize.bits.raw r1.body[9u32] (u128) into r71 ([boolean; 128u32]);\n deserialize.bits.raw r71 ([boolean; 128u32]) into r72 ([u8; 16u32]);\n serialize.bits.raw r1.body[10u32] (u128) into r73 ([boolean; 128u32]);\n deserialize.bits.raw r73 ([boolean; 128u32]) into r74 ([u8; 16u32]);\n serialize.bits.raw r1.body[11u32] (u128) into r75 ([boolean; 128u32]);\n deserialize.bits.raw r75 ([boolean; 128u32]) into r76 ([u8; 16u32]);\n serialize.bits.raw r1.body[12u32] (u128) into r77 ([boolean; 128u32]);\n deserialize.bits.raw r77 ([boolean; 128u32]) into r78 ([u8; 16u32]);\n serialize.bits.raw r1.body[13u32] (u128) into r79 ([boolean; 128u32]);\n deserialize.bits.raw r79 ([boolean; 128u32]) into r80 ([u8; 16u32]);\n serialize.bits.raw r1.body[14u32] (u128) into r81 ([boolean; 128u32]);\n deserialize.bits.raw r81 ([boolean; 128u32]) into r82 ([u8; 16u32]);\n serialize.bits.raw r1.body[15u32] (u128) into r83 ([boolean; 128u32]);\n deserialize.bits.raw r83 ([boolean; 128u32]) into r84 ([u8; 16u32]);\n cast r1.version r30[0u32] r30[1u32] r30[2u32] r30[3u32] r41[0u32] r41[1u32] r41[2u32] r41[3u32] r1.sender[0u32] r1.sender[1u32] r1.sender[2u32] r1.sender[3u32] r1.sender[4u32] r1.sender[5u32] r1.sender[6u32] r1.sender[7u32] r1.sender[8u32] r1.sender[9u32] r1.sender[10u32] r1.sender[11u32] r1.sender[12u32] r1.sender[13u32] r1.sender[14u32] r1.sender[15u32] r1.sender[16u32] r1.sender[17u32] r1.sender[18u32] r1.sender[19u32] r1.sender[20u32] r1.sender[21u32] r1.sender[22u32] r1.sender[23u32] r1.sender[24u32] r1.sender[25u32] r1.sender[26u32] r1.sender[27u32] r1.sender[28u32] r1.sender[29u32] r1.sender[30u32] r1.sender[31u32] r52[0u32] r52[1u32] r52[2u32] r52[3u32] r1.recipient[0u32] r1.recipient[1u32] r1.recipient[2u32] r1.recipient[3u32] r1.recipient[4u32] r1.recipient[5u32] r1.recipient[6u32] r1.recipient[7u32] r1.recipient[8u32] r1.recipient[9u32] r1.recipient[10u32] r1.recipient[11u32] r1.recipient[12u32] r1.recipient[13u32] r1.recipient[14u32] r1.recipient[15u32] r1.recipient[16u32] r1.recipient[17u32] r1.recipient[18u32] r1.recipient[19u32] r1.recipient[20u32] r1.recipient[21u32] r1.recipient[22u32] r1.recipient[23u32] r1.recipient[24u32] r1.recipient[25u32] r1.recipient[26u32] r1.recipient[27u32] r1.recipient[28u32] r1.recipient[29u32] r1.recipient[30u32] r1.recipient[31u32] r54[0u32] r54[1u32] r54[2u32] r54[3u32] r54[4u32] r54[5u32] r54[6u32] r54[7u32] r54[8u32] r54[9u32] r54[10u32] r54[11u32] r54[12u32] r54[13u32] r54[14u32] r54[15u32] r56[0u32] r56[1u32] r56[2u32] r56[3u32] r56[4u32] r56[5u32] r56[6u32] r56[7u32] r56[8u32] r56[9u32] r56[10u32] r56[11u32] r56[12u32] r56[13u32] r56[14u32] r56[15u32] r58[0u32] r58[1u32] r58[2u32] r58[3u32] r58[4u32] r58[5u32] r58[6u32] r58[7u32] r58[8u32] r58[9u32] r58[10u32] r58[11u32] r58[12u32] r58[13u32] r58[14u32] r58[15u32] r60[0u32] r60[1u32] r60[2u32] r60[3u32] r60[4u32] r60[5u32] r60[6u32] r60[7u32] r60[8u32] r60[9u32] r60[10u32] r60[11u32] r60[12u32] r60[13u32] r60[14u32] r60[15u32] r62[0u32] r62[1u32] r62[2u32] r62[3u32] r62[4u32] r62[5u32] r62[6u32] r62[7u32] r62[8u32] r62[9u32] r62[10u32] r62[11u32] r62[12u32] r62[13u32] r62[14u32] r62[15u32] r64[0u32] r64[1u32] r64[2u32] r64[3u32] r64[4u32] r64[5u32] r64[6u32] r64[7u32] r64[8u32] r64[9u32] r64[10u32] r64[11u32] r64[12u32] r64[13u32] r64[14u32] r64[15u32] r66[0u32] r66[1u32] r66[2u32] r66[3u32] r66[4u32] r66[5u32] r66[6u32] r66[7u32] r66[8u32] r66[9u32] r66[10u32] r66[11u32] r66[12u32] r66[13u32] r66[14u32] r66[15u32] r68[0u32] r68[1u32] r68[2u32] r68[3u32] r68[4u32] r68[5u32] r68[6u32] r68[7u32] r68[8u32] r68[9u32] r68[10u32] r68[11u32] r68[12u32] r68[13u32] r68[14u32] r68[15u32] r70[0u32] r70[1u32] r70[2u32] r70[3u32] r70[4u32] r70[5u32] r70[6u32] r70[7u32] r70[8u32] r70[9u32] r70[10u32] r70[11u32] r70[12u32] r70[13u32] r70[14u32] r70[15u32] r72[0u32] r72[1u32] r72[2u32] r72[3u32] r72[4u32] r72[5u32] r72[6u32] r72[7u32] r72[8u32] r72[9u32] r72[10u32] r72[11u32] r72[12u32] r72[13u32] r72[14u32] r72[15u32] r74[0u32] r74[1u32] r74[2u32] r74[3u32] r74[4u32] r74[5u32] r74[6u32] r74[7u32] r74[8u32] r74[9u32] r74[10u32] r74[11u32] r74[12u32] r74[13u32] r74[14u32] r74[15u32] r76[0u32] r76[1u32] r76[2u32] r76[3u32] r76[4u32] r76[5u32] r76[6u32] r76[7u32] r76[8u32] r76[9u32] r76[10u32] r76[11u32] r76[12u32] r76[13u32] r76[14u32] r76[15u32] r78[0u32] r78[1u32] r78[2u32] r78[3u32] r78[4u32] r78[5u32] r78[6u32] r78[7u32] r78[8u32] r78[9u32] r78[10u32] r78[11u32] r78[12u32] r78[13u32] r78[14u32] r78[15u32] r80[0u32] r80[1u32] r80[2u32] r80[3u32] r80[4u32] r80[5u32] r80[6u32] r80[7u32] r80[8u32] r80[9u32] r80[10u32] r80[11u32] r80[12u32] r80[13u32] r80[14u32] r80[15u32] r82[0u32] r82[1u32] r82[2u32] r82[3u32] r82[4u32] r82[5u32] r82[6u32] r82[7u32] r82[8u32] r82[9u32] r82[10u32] r82[11u32] r82[12u32] r82[13u32] r82[14u32] r82[15u32] r84[0u32] r84[1u32] r84[2u32] r84[3u32] r84[4u32] r84[5u32] r84[6u32] r84[7u32] r84[8u32] r84[9u32] r84[10u32] r84[11u32] r84[12u32] r84[13u32] r84[14u32] r84[15u32] into r85 as [u8; 333u32];\n is.eq r2 77u32 into r86;\n cast r85[0u32] r85[1u32] r85[2u32] r85[3u32] r85[4u32] r85[5u32] r85[6u32] r85[7u32] r85[8u32] r85[9u32] r85[10u32] r85[11u32] r85[12u32] r85[13u32] r85[14u32] r85[15u32] r85[16u32] r85[17u32] r85[18u32] r85[19u32] r85[20u32] r85[21u32] r85[22u32] r85[23u32] r85[24u32] r85[25u32] r85[26u32] r85[27u32] r85[28u32] r85[29u32] r85[30u32] r85[31u32] r85[32u32] r85[33u32] r85[34u32] r85[35u32] r85[36u32] r85[37u32] r85[38u32] r85[39u32] r85[40u32] r85[41u32] r85[42u32] r85[43u32] r85[44u32] r85[45u32] r85[46u32] r85[47u32] r85[48u32] r85[49u32] r85[50u32] r85[51u32] r85[52u32] r85[53u32] r85[54u32] r85[55u32] r85[56u32] r85[57u32] r85[58u32] r85[59u32] r85[60u32] r85[61u32] r85[62u32] r85[63u32] r85[64u32] r85[65u32] r85[66u32] r85[67u32] r85[68u32] r85[69u32] r85[70u32] r85[71u32] r85[72u32] r85[73u32] r85[74u32] r85[75u32] r85[76u32] into r87 as [u8; 77u32];\n hash.keccak256.native.raw r87 into r88 as [boolean; 256u32];\n deserialize.bits.raw r88 ([boolean; 256u32]) into r89 ([u128; 2u32]);\n is.eq r2 93u32 into r90;\n cast r85[0u32] r85[1u32] r85[2u32] r85[3u32] r85[4u32] r85[5u32] r85[6u32] r85[7u32] r85[8u32] r85[9u32] r85[10u32] r85[11u32] r85[12u32] r85[13u32] r85[14u32] r85[15u32] r85[16u32] r85[17u32] r85[18u32] r85[19u32] r85[20u32] r85[21u32] r85[22u32] r85[23u32] r85[24u32] r85[25u32] r85[26u32] r85[27u32] r85[28u32] r85[29u32] r85[30u32] r85[31u32] r85[32u32] r85[33u32] r85[34u32] r85[35u32] r85[36u32] r85[37u32] r85[38u32] r85[39u32] r85[40u32] r85[41u32] r85[42u32] r85[43u32] r85[44u32] r85[45u32] r85[46u32] r85[47u32] r85[48u32] r85[49u32] r85[50u32] r85[51u32] r85[52u32] r85[53u32] r85[54u32] r85[55u32] r85[56u32] r85[57u32] r85[58u32] r85[59u32] r85[60u32] r85[61u32] r85[62u32] r85[63u32] r85[64u32] r85[65u32] r85[66u32] r85[67u32] r85[68u32] r85[69u32] r85[70u32] r85[71u32] r85[72u32] r85[73u32] r85[74u32] r85[75u32] r85[76u32] r85[77u32] r85[78u32] r85[79u32] r85[80u32] r85[81u32] r85[82u32] r85[83u32] r85[84u32] r85[85u32] r85[86u32] r85[87u32] r85[88u32] r85[89u32] r85[90u32] r85[91u32] r85[92u32] into r91 as [u8; 93u32];\n hash.keccak256.native.raw r91 into r92 as [boolean; 256u32];\n deserialize.bits.raw r92 ([boolean; 256u32]) into r93 ([u128; 2u32]);\n is.eq r2 109u32 into r94;\n cast r85[0u32] r85[1u32] r85[2u32] r85[3u32] r85[4u32] r85[5u32] r85[6u32] r85[7u32] r85[8u32] r85[9u32] r85[10u32] r85[11u32] r85[12u32] r85[13u32] r85[14u32] r85[15u32] r85[16u32] r85[17u32] r85[18u32] r85[19u32] r85[20u32] r85[21u32] r85[22u32] r85[23u32] r85[24u32] r85[25u32] r85[26u32] r85[27u32] r85[28u32] r85[29u32] r85[30u32] r85[31u32] r85[32u32] r85[33u32] r85[34u32] r85[35u32] r85[36u32] r85[37u32] r85[38u32] r85[39u32] r85[40u32] r85[41u32] r85[42u32] r85[43u32] r85[44u32] r85[45u32] r85[46u32] r85[47u32] r85[48u32] r85[49u32] r85[50u32] r85[51u32] r85[52u32] r85[53u32] r85[54u32] r85[55u32] r85[56u32] r85[57u32] r85[58u32] r85[59u32] r85[60u32] r85[61u32] r85[62u32] r85[63u32] r85[64u32] r85[65u32] r85[66u32] r85[67u32] r85[68u32] r85[69u32] r85[70u32] r85[71u32] r85[72u32] r85[73u32] r85[74u32] r85[75u32] r85[76u32] r85[77u32] r85[78u32] r85[79u32] r85[80u32] r85[81u32] r85[82u32] r85[83u32] r85[84u32] r85[85u32] r85[86u32] r85[87u32] r85[88u32] r85[89u32] r85[90u32] r85[91u32] r85[92u32] r85[93u32] r85[94u32] r85[95u32] r85[96u32] r85[97u32] r85[98u32] r85[99u32] r85[100u32] r85[101u32] r85[102u32] r85[103u32] r85[104u32] r85[105u32] r85[106u32] r85[107u32] r85[108u32] into r95 as [u8; 109u32];\n hash.keccak256.native.raw r95 into r96 as [boolean; 256u32];\n deserialize.bits.raw r96 ([boolean; 256u32]) into r97 ([u128; 2u32]);\n is.eq r2 125u32 into r98;\n cast r85[0u32] r85[1u32] r85[2u32] r85[3u32] r85[4u32] r85[5u32] r85[6u32] r85[7u32] r85[8u32] r85[9u32] r85[10u32] r85[11u32] r85[12u32] r85[13u32] r85[14u32] r85[15u32] r85[16u32] r85[17u32] r85[18u32] r85[19u32] r85[20u32] r85[21u32] r85[22u32] r85[23u32] r85[24u32] r85[25u32] r85[26u32] r85[27u32] r85[28u32] r85[29u32] r85[30u32] r85[31u32] r85[32u32] r85[33u32] r85[34u32] r85[35u32] r85[36u32] r85[37u32] r85[38u32] r85[39u32] r85[40u32] r85[41u32] r85[42u32] r85[43u32] r85[44u32] r85[45u32] r85[46u32] r85[47u32] r85[48u32] r85[49u32] r85[50u32] r85[51u32] r85[52u32] r85[53u32] r85[54u32] r85[55u32] r85[56u32] r85[57u32] r85[58u32] r85[59u32] r85[60u32] r85[61u32] r85[62u32] r85[63u32] r85[64u32] r85[65u32] r85[66u32] r85[67u32] r85[68u32] r85[69u32] r85[70u32] r85[71u32] r85[72u32] r85[73u32] r85[74u32] r85[75u32] r85[76u32] r85[77u32] r85[78u32] r85[79u32] r85[80u32] r85[81u32] r85[82u32] r85[83u32] r85[84u32] r85[85u32] r85[86u32] r85[87u32] r85[88u32] r85[89u32] r85[90u32] r85[91u32] r85[92u32] r85[93u32] r85[94u32] r85[95u32] r85[96u32] r85[97u32] r85[98u32] r85[99u32] r85[100u32] r85[101u32] r85[102u32] r85[103u32] r85[104u32] r85[105u32] r85[106u32] r85[107u32] r85[108u32] r85[109u32] r85[110u32] r85[111u32] r85[112u32] r85[113u32] r85[114u32] r85[115u32] r85[116u32] r85[117u32] r85[118u32] r85[119u32] r85[120u32] r85[121u32] r85[122u32] r85[123u32] r85[124u32] into r99 as [u8; 125u32];\n hash.keccak256.native.raw r99 into r100 as [boolean; 256u32];\n deserialize.bits.raw r100 ([boolean; 256u32]) into r101 ([u128; 2u32]);\n is.eq r2 141u32 into r102;\n cast r85[0u32] r85[1u32] r85[2u32] r85[3u32] r85[4u32] r85[5u32] r85[6u32] r85[7u32] r85[8u32] r85[9u32] r85[10u32] r85[11u32] r85[12u32] r85[13u32] r85[14u32] r85[15u32] r85[16u32] r85[17u32] r85[18u32] r85[19u32] r85[20u32] r85[21u32] r85[22u32] r85[23u32] r85[24u32] r85[25u32] r85[26u32] r85[27u32] r85[28u32] r85[29u32] r85[30u32] r85[31u32] r85[32u32] r85[33u32] r85[34u32] r85[35u32] r85[36u32] r85[37u32] r85[38u32] r85[39u32] r85[40u32] r85[41u32] r85[42u32] r85[43u32] r85[44u32] r85[45u32] r85[46u32] r85[47u32] r85[48u32] r85[49u32] r85[50u32] r85[51u32] r85[52u32] r85[53u32] r85[54u32] r85[55u32] r85[56u32] r85[57u32] r85[58u32] r85[59u32] r85[60u32] r85[61u32] r85[62u32] r85[63u32] r85[64u32] r85[65u32] r85[66u32] r85[67u32] r85[68u32] r85[69u32] r85[70u32] r85[71u32] r85[72u32] r85[73u32] r85[74u32] r85[75u32] r85[76u32] r85[77u32] r85[78u32] r85[79u32] r85[80u32] r85[81u32] r85[82u32] r85[83u32] r85[84u32] r85[85u32] r85[86u32] r85[87u32] r85[88u32] r85[89u32] r85[90u32] r85[91u32] r85[92u32] r85[93u32] r85[94u32] r85[95u32] r85[96u32] r85[97u32] r85[98u32] r85[99u32] r85[100u32] r85[101u32] r85[102u32] r85[103u32] r85[104u32] r85[105u32] r85[106u32] r85[107u32] r85[108u32] r85[109u32] r85[110u32] r85[111u32] r85[112u32] r85[113u32] r85[114u32] r85[115u32] r85[116u32] r85[117u32] r85[118u32] r85[119u32] r85[120u32] r85[121u32] r85[122u32] r85[123u32] r85[124u32] r85[125u32] r85[126u32] r85[127u32] r85[128u32] r85[129u32] r85[130u32] r85[131u32] r85[132u32] r85[133u32] r85[134u32] r85[135u32] r85[136u32] r85[137u32] r85[138u32] r85[139u32] r85[140u32] into r103 as [u8; 141u32];\n hash.keccak256.native.raw r103 into r104 as [boolean; 256u32];\n deserialize.bits.raw r104 ([boolean; 256u32]) into r105 ([u128; 2u32]);\n is.eq r2 157u32 into r106;\n cast r85[0u32] r85[1u32] r85[2u32] r85[3u32] r85[4u32] r85[5u32] r85[6u32] r85[7u32] r85[8u32] r85[9u32] r85[10u32] r85[11u32] r85[12u32] r85[13u32] r85[14u32] r85[15u32] r85[16u32] r85[17u32] r85[18u32] r85[19u32] r85[20u32] r85[21u32] r85[22u32] r85[23u32] r85[24u32] r85[25u32] r85[26u32] r85[27u32] r85[28u32] r85[29u32] r85[30u32] r85[31u32] r85[32u32] r85[33u32] r85[34u32] r85[35u32] r85[36u32] r85[37u32] r85[38u32] r85[39u32] r85[40u32] r85[41u32] r85[42u32] r85[43u32] r85[44u32] r85[45u32] r85[46u32] r85[47u32] r85[48u32] r85[49u32] r85[50u32] r85[51u32] r85[52u32] r85[53u32] r85[54u32] r85[55u32] r85[56u32] r85[57u32] r85[58u32] r85[59u32] r85[60u32] r85[61u32] r85[62u32] r85[63u32] r85[64u32] r85[65u32] r85[66u32] r85[67u32] r85[68u32] r85[69u32] r85[70u32] r85[71u32] r85[72u32] r85[73u32] r85[74u32] r85[75u32] r85[76u32] r85[77u32] r85[78u32] r85[79u32] r85[80u32] r85[81u32] r85[82u32] r85[83u32] r85[84u32] r85[85u32] r85[86u32] r85[87u32] r85[88u32] r85[89u32] r85[90u32] r85[91u32] r85[92u32] r85[93u32] r85[94u32] r85[95u32] r85[96u32] r85[97u32] r85[98u32] r85[99u32] r85[100u32] r85[101u32] r85[102u32] r85[103u32] r85[104u32] r85[105u32] r85[106u32] r85[107u32] r85[108u32] r85[109u32] r85[110u32] r85[111u32] r85[112u32] r85[113u32] r85[114u32] r85[115u32] r85[116u32] r85[117u32] r85[118u32] r85[119u32] r85[120u32] r85[121u32] r85[122u32] r85[123u32] r85[124u32] r85[125u32] r85[126u32] r85[127u32] r85[128u32] r85[129u32] r85[130u32] r85[131u32] r85[132u32] r85[133u32] r85[134u32] r85[135u32] r85[136u32] r85[137u32] r85[138u32] r85[139u32] r85[140u32] r85[141u32] r85[142u32] r85[143u32] r85[144u32] r85[145u32] r85[146u32] r85[147u32] r85[148u32] r85[149u32] r85[150u32] r85[151u32] r85[152u32] r85[153u32] r85[154u32] r85[155u32] r85[156u32] into r107 as [u8; 157u32];\n hash.keccak256.native.raw r107 into r108 as [boolean; 256u32];\n deserialize.bits.raw r108 ([boolean; 256u32]) into r109 ([u128; 2u32]);\n is.eq r2 173u32 into r110;\n cast r85[0u32] r85[1u32] r85[2u32] r85[3u32] r85[4u32] r85[5u32] r85[6u32] r85[7u32] r85[8u32] r85[9u32] r85[10u32] r85[11u32] r85[12u32] r85[13u32] r85[14u32] r85[15u32] r85[16u32] r85[17u32] r85[18u32] r85[19u32] r85[20u32] r85[21u32] r85[22u32] r85[23u32] r85[24u32] r85[25u32] r85[26u32] r85[27u32] r85[28u32] r85[29u32] r85[30u32] r85[31u32] r85[32u32] r85[33u32] r85[34u32] r85[35u32] r85[36u32] r85[37u32] r85[38u32] r85[39u32] r85[40u32] r85[41u32] r85[42u32] r85[43u32] r85[44u32] r85[45u32] r85[46u32] r85[47u32] r85[48u32] r85[49u32] r85[50u32] r85[51u32] r85[52u32] r85[53u32] r85[54u32] r85[55u32] r85[56u32] r85[57u32] r85[58u32] r85[59u32] r85[60u32] r85[61u32] r85[62u32] r85[63u32] r85[64u32] r85[65u32] r85[66u32] r85[67u32] r85[68u32] r85[69u32] r85[70u32] r85[71u32] r85[72u32] r85[73u32] r85[74u32] r85[75u32] r85[76u32] r85[77u32] r85[78u32] r85[79u32] r85[80u32] r85[81u32] r85[82u32] r85[83u32] r85[84u32] r85[85u32] r85[86u32] r85[87u32] r85[88u32] r85[89u32] r85[90u32] r85[91u32] r85[92u32] r85[93u32] r85[94u32] r85[95u32] r85[96u32] r85[97u32] r85[98u32] r85[99u32] r85[100u32] r85[101u32] r85[102u32] r85[103u32] r85[104u32] r85[105u32] r85[106u32] r85[107u32] r85[108u32] r85[109u32] r85[110u32] r85[111u32] r85[112u32] r85[113u32] r85[114u32] r85[115u32] r85[116u32] r85[117u32] r85[118u32] r85[119u32] r85[120u32] r85[121u32] r85[122u32] r85[123u32] r85[124u32] r85[125u32] r85[126u32] r85[127u32] r85[128u32] r85[129u32] r85[130u32] r85[131u32] r85[132u32] r85[133u32] r85[134u32] r85[135u32] r85[136u32] r85[137u32] r85[138u32] r85[139u32] r85[140u32] r85[141u32] r85[142u32] r85[143u32] r85[144u32] r85[145u32] r85[146u32] r85[147u32] r85[148u32] r85[149u32] r85[150u32] r85[151u32] r85[152u32] r85[153u32] r85[154u32] r85[155u32] r85[156u32] r85[157u32] r85[158u32] r85[159u32] r85[160u32] r85[161u32] r85[162u32] r85[163u32] r85[164u32] r85[165u32] r85[166u32] r85[167u32] r85[168u32] r85[169u32] r85[170u32] r85[171u32] r85[172u32] into r111 as [u8; 173u32];\n hash.keccak256.native.raw r111 into r112 as [boolean; 256u32];\n deserialize.bits.raw r112 ([boolean; 256u32]) into r113 ([u128; 2u32]);\n is.eq r2 189u32 into r114;\n cast r85[0u32] r85[1u32] r85[2u32] r85[3u32] r85[4u32] r85[5u32] r85[6u32] r85[7u32] r85[8u32] r85[9u32] r85[10u32] r85[11u32] r85[12u32] r85[13u32] r85[14u32] r85[15u32] r85[16u32] r85[17u32] r85[18u32] r85[19u32] r85[20u32] r85[21u32] r85[22u32] r85[23u32] r85[24u32] r85[25u32] r85[26u32] r85[27u32] r85[28u32] r85[29u32] r85[30u32] r85[31u32] r85[32u32] r85[33u32] r85[34u32] r85[35u32] r85[36u32] r85[37u32] r85[38u32] r85[39u32] r85[40u32] r85[41u32] r85[42u32] r85[43u32] r85[44u32] r85[45u32] r85[46u32] r85[47u32] r85[48u32] r85[49u32] r85[50u32] r85[51u32] r85[52u32] r85[53u32] r85[54u32] r85[55u32] r85[56u32] r85[57u32] r85[58u32] r85[59u32] r85[60u32] r85[61u32] r85[62u32] r85[63u32] r85[64u32] r85[65u32] r85[66u32] r85[67u32] r85[68u32] r85[69u32] r85[70u32] r85[71u32] r85[72u32] r85[73u32] r85[74u32] r85[75u32] r85[76u32] r85[77u32] r85[78u32] r85[79u32] r85[80u32] r85[81u32] r85[82u32] r85[83u32] r85[84u32] r85[85u32] r85[86u32] r85[87u32] r85[88u32] r85[89u32] r85[90u32] r85[91u32] r85[92u32] r85[93u32] r85[94u32] r85[95u32] r85[96u32] r85[97u32] r85[98u32] r85[99u32] r85[100u32] r85[101u32] r85[102u32] r85[103u32] r85[104u32] r85[105u32] r85[106u32] r85[107u32] r85[108u32] r85[109u32] r85[110u32] r85[111u32] r85[112u32] r85[113u32] r85[114u32] r85[115u32] r85[116u32] r85[117u32] r85[118u32] r85[119u32] r85[120u32] r85[121u32] r85[122u32] r85[123u32] r85[124u32] r85[125u32] r85[126u32] r85[127u32] r85[128u32] r85[129u32] r85[130u32] r85[131u32] r85[132u32] r85[133u32] r85[134u32] r85[135u32] r85[136u32] r85[137u32] r85[138u32] r85[139u32] r85[140u32] r85[141u32] r85[142u32] r85[143u32] r85[144u32] r85[145u32] r85[146u32] r85[147u32] r85[148u32] r85[149u32] r85[150u32] r85[151u32] r85[152u32] r85[153u32] r85[154u32] r85[155u32] r85[156u32] r85[157u32] r85[158u32] r85[159u32] r85[160u32] r85[161u32] r85[162u32] r85[163u32] r85[164u32] r85[165u32] r85[166u32] r85[167u32] r85[168u32] r85[169u32] r85[170u32] r85[171u32] r85[172u32] r85[173u32] r85[174u32] r85[175u32] r85[176u32] r85[177u32] r85[178u32] r85[179u32] r85[180u32] r85[181u32] r85[182u32] r85[183u32] r85[184u32] r85[185u32] r85[186u32] r85[187u32] r85[188u32] into r115 as [u8; 189u32];\n hash.keccak256.native.raw r115 into r116 as [boolean; 256u32];\n deserialize.bits.raw r116 ([boolean; 256u32]) into r117 ([u128; 2u32]);\n is.eq r2 205u32 into r118;\n cast r85[0u32] r85[1u32] r85[2u32] r85[3u32] r85[4u32] r85[5u32] r85[6u32] r85[7u32] r85[8u32] r85[9u32] r85[10u32] r85[11u32] r85[12u32] r85[13u32] r85[14u32] r85[15u32] r85[16u32] r85[17u32] r85[18u32] r85[19u32] r85[20u32] r85[21u32] r85[22u32] r85[23u32] r85[24u32] r85[25u32] r85[26u32] r85[27u32] r85[28u32] r85[29u32] r85[30u32] r85[31u32] r85[32u32] r85[33u32] r85[34u32] r85[35u32] r85[36u32] r85[37u32] r85[38u32] r85[39u32] r85[40u32] r85[41u32] r85[42u32] r85[43u32] r85[44u32] r85[45u32] r85[46u32] r85[47u32] r85[48u32] r85[49u32] r85[50u32] r85[51u32] r85[52u32] r85[53u32] r85[54u32] r85[55u32] r85[56u32] r85[57u32] r85[58u32] r85[59u32] r85[60u32] r85[61u32] r85[62u32] r85[63u32] r85[64u32] r85[65u32] r85[66u32] r85[67u32] r85[68u32] r85[69u32] r85[70u32] r85[71u32] r85[72u32] r85[73u32] r85[74u32] r85[75u32] r85[76u32] r85[77u32] r85[78u32] r85[79u32] r85[80u32] r85[81u32] r85[82u32] r85[83u32] r85[84u32] r85[85u32] r85[86u32] r85[87u32] r85[88u32] r85[89u32] r85[90u32] r85[91u32] r85[92u32] r85[93u32] r85[94u32] r85[95u32] r85[96u32] r85[97u32] r85[98u32] r85[99u32] r85[100u32] r85[101u32] r85[102u32] r85[103u32] r85[104u32] r85[105u32] r85[106u32] r85[107u32] r85[108u32] r85[109u32] r85[110u32] r85[111u32] r85[112u32] r85[113u32] r85[114u32] r85[115u32] r85[116u32] r85[117u32] r85[118u32] r85[119u32] r85[120u32] r85[121u32] r85[122u32] r85[123u32] r85[124u32] r85[125u32] r85[126u32] r85[127u32] r85[128u32] r85[129u32] r85[130u32] r85[131u32] r85[132u32] r85[133u32] r85[134u32] r85[135u32] r85[136u32] r85[137u32] r85[138u32] r85[139u32] r85[140u32] r85[141u32] r85[142u32] r85[143u32] r85[144u32] r85[145u32] r85[146u32] r85[147u32] r85[148u32] r85[149u32] r85[150u32] r85[151u32] r85[152u32] r85[153u32] r85[154u32] r85[155u32] r85[156u32] r85[157u32] r85[158u32] r85[159u32] r85[160u32] r85[161u32] r85[162u32] r85[163u32] r85[164u32] r85[165u32] r85[166u32] r85[167u32] r85[168u32] r85[169u32] r85[170u32] r85[171u32] r85[172u32] r85[173u32] r85[174u32] r85[175u32] r85[176u32] r85[177u32] r85[178u32] r85[179u32] r85[180u32] r85[181u32] r85[182u32] r85[183u32] r85[184u32] r85[185u32] r85[186u32] r85[187u32] r85[188u32] r85[189u32] r85[190u32] r85[191u32] r85[192u32] r85[193u32] r85[194u32] r85[195u32] r85[196u32] r85[197u32] r85[198u32] r85[199u32] r85[200u32] r85[201u32] r85[202u32] r85[203u32] r85[204u32] into r119 as [u8; 205u32];\n hash.keccak256.native.raw r119 into r120 as [boolean; 256u32];\n deserialize.bits.raw r120 ([boolean; 256u32]) into r121 ([u128; 2u32]);\n is.eq r2 221u32 into r122;\n cast r85[0u32] r85[1u32] r85[2u32] r85[3u32] r85[4u32] r85[5u32] r85[6u32] r85[7u32] r85[8u32] r85[9u32] r85[10u32] r85[11u32] r85[12u32] r85[13u32] r85[14u32] r85[15u32] r85[16u32] r85[17u32] r85[18u32] r85[19u32] r85[20u32] r85[21u32] r85[22u32] r85[23u32] r85[24u32] r85[25u32] r85[26u32] r85[27u32] r85[28u32] r85[29u32] r85[30u32] r85[31u32] r85[32u32] r85[33u32] r85[34u32] r85[35u32] r85[36u32] r85[37u32] r85[38u32] r85[39u32] r85[40u32] r85[41u32] r85[42u32] r85[43u32] r85[44u32] r85[45u32] r85[46u32] r85[47u32] r85[48u32] r85[49u32] r85[50u32] r85[51u32] r85[52u32] r85[53u32] r85[54u32] r85[55u32] r85[56u32] r85[57u32] r85[58u32] r85[59u32] r85[60u32] r85[61u32] r85[62u32] r85[63u32] r85[64u32] r85[65u32] r85[66u32] r85[67u32] r85[68u32] r85[69u32] r85[70u32] r85[71u32] r85[72u32] r85[73u32] r85[74u32] r85[75u32] r85[76u32] r85[77u32] r85[78u32] r85[79u32] r85[80u32] r85[81u32] r85[82u32] r85[83u32] r85[84u32] r85[85u32] r85[86u32] r85[87u32] r85[88u32] r85[89u32] r85[90u32] r85[91u32] r85[92u32] r85[93u32] r85[94u32] r85[95u32] r85[96u32] r85[97u32] r85[98u32] r85[99u32] r85[100u32] r85[101u32] r85[102u32] r85[103u32] r85[104u32] r85[105u32] r85[106u32] r85[107u32] r85[108u32] r85[109u32] r85[110u32] r85[111u32] r85[112u32] r85[113u32] r85[114u32] r85[115u32] r85[116u32] r85[117u32] r85[118u32] r85[119u32] r85[120u32] r85[121u32] r85[122u32] r85[123u32] r85[124u32] r85[125u32] r85[126u32] r85[127u32] r85[128u32] r85[129u32] r85[130u32] r85[131u32] r85[132u32] r85[133u32] r85[134u32] r85[135u32] r85[136u32] r85[137u32] r85[138u32] r85[139u32] r85[140u32] r85[141u32] r85[142u32] r85[143u32] r85[144u32] r85[145u32] r85[146u32] r85[147u32] r85[148u32] r85[149u32] r85[150u32] r85[151u32] r85[152u32] r85[153u32] r85[154u32] r85[155u32] r85[156u32] r85[157u32] r85[158u32] r85[159u32] r85[160u32] r85[161u32] r85[162u32] r85[163u32] r85[164u32] r85[165u32] r85[166u32] r85[167u32] r85[168u32] r85[169u32] r85[170u32] r85[171u32] r85[172u32] r85[173u32] r85[174u32] r85[175u32] r85[176u32] r85[177u32] r85[178u32] r85[179u32] r85[180u32] r85[181u32] r85[182u32] r85[183u32] r85[184u32] r85[185u32] r85[186u32] r85[187u32] r85[188u32] r85[189u32] r85[190u32] r85[191u32] r85[192u32] r85[193u32] r85[194u32] r85[195u32] r85[196u32] r85[197u32] r85[198u32] r85[199u32] r85[200u32] r85[201u32] r85[202u32] r85[203u32] r85[204u32] r85[205u32] r85[206u32] r85[207u32] r85[208u32] r85[209u32] r85[210u32] r85[211u32] r85[212u32] r85[213u32] r85[214u32] r85[215u32] r85[216u32] r85[217u32] r85[218u32] r85[219u32] r85[220u32] into r123 as [u8; 221u32];\n hash.keccak256.native.raw r123 into r124 as [boolean; 256u32];\n deserialize.bits.raw r124 ([boolean; 256u32]) into r125 ([u128; 2u32]);\n is.eq r2 237u32 into r126;\n cast r85[0u32] r85[1u32] r85[2u32] r85[3u32] r85[4u32] r85[5u32] r85[6u32] r85[7u32] r85[8u32] r85[9u32] r85[10u32] r85[11u32] r85[12u32] r85[13u32] r85[14u32] r85[15u32] r85[16u32] r85[17u32] r85[18u32] r85[19u32] r85[20u32] r85[21u32] r85[22u32] r85[23u32] r85[24u32] r85[25u32] r85[26u32] r85[27u32] r85[28u32] r85[29u32] r85[30u32] r85[31u32] r85[32u32] r85[33u32] r85[34u32] r85[35u32] r85[36u32] r85[37u32] r85[38u32] r85[39u32] r85[40u32] r85[41u32] r85[42u32] r85[43u32] r85[44u32] r85[45u32] r85[46u32] r85[47u32] r85[48u32] r85[49u32] r85[50u32] r85[51u32] r85[52u32] r85[53u32] r85[54u32] r85[55u32] r85[56u32] r85[57u32] r85[58u32] r85[59u32] r85[60u32] r85[61u32] r85[62u32] r85[63u32] r85[64u32] r85[65u32] r85[66u32] r85[67u32] r85[68u32] r85[69u32] r85[70u32] r85[71u32] r85[72u32] r85[73u32] r85[74u32] r85[75u32] r85[76u32] r85[77u32] r85[78u32] r85[79u32] r85[80u32] r85[81u32] r85[82u32] r85[83u32] r85[84u32] r85[85u32] r85[86u32] r85[87u32] r85[88u32] r85[89u32] r85[90u32] r85[91u32] r85[92u32] r85[93u32] r85[94u32] r85[95u32] r85[96u32] r85[97u32] r85[98u32] r85[99u32] r85[100u32] r85[101u32] r85[102u32] r85[103u32] r85[104u32] r85[105u32] r85[106u32] r85[107u32] r85[108u32] r85[109u32] r85[110u32] r85[111u32] r85[112u32] r85[113u32] r85[114u32] r85[115u32] r85[116u32] r85[117u32] r85[118u32] r85[119u32] r85[120u32] r85[121u32] r85[122u32] r85[123u32] r85[124u32] r85[125u32] r85[126u32] r85[127u32] r85[128u32] r85[129u32] r85[130u32] r85[131u32] r85[132u32] r85[133u32] r85[134u32] r85[135u32] r85[136u32] r85[137u32] r85[138u32] r85[139u32] r85[140u32] r85[141u32] r85[142u32] r85[143u32] r85[144u32] r85[145u32] r85[146u32] r85[147u32] r85[148u32] r85[149u32] r85[150u32] r85[151u32] r85[152u32] r85[153u32] r85[154u32] r85[155u32] r85[156u32] r85[157u32] r85[158u32] r85[159u32] r85[160u32] r85[161u32] r85[162u32] r85[163u32] r85[164u32] r85[165u32] r85[166u32] r85[167u32] r85[168u32] r85[169u32] r85[170u32] r85[171u32] r85[172u32] r85[173u32] r85[174u32] r85[175u32] r85[176u32] r85[177u32] r85[178u32] r85[179u32] r85[180u32] r85[181u32] r85[182u32] r85[183u32] r85[184u32] r85[185u32] r85[186u32] r85[187u32] r85[188u32] r85[189u32] r85[190u32] r85[191u32] r85[192u32] r85[193u32] r85[194u32] r85[195u32] r85[196u32] r85[197u32] r85[198u32] r85[199u32] r85[200u32] r85[201u32] r85[202u32] r85[203u32] r85[204u32] r85[205u32] r85[206u32] r85[207u32] r85[208u32] r85[209u32] r85[210u32] r85[211u32] r85[212u32] r85[213u32] r85[214u32] r85[215u32] r85[216u32] r85[217u32] r85[218u32] r85[219u32] r85[220u32] r85[221u32] r85[222u32] r85[223u32] r85[224u32] r85[225u32] r85[226u32] r85[227u32] r85[228u32] r85[229u32] r85[230u32] r85[231u32] r85[232u32] r85[233u32] r85[234u32] r85[235u32] r85[236u32] into r127 as [u8; 237u32];\n hash.keccak256.native.raw r127 into r128 as [boolean; 256u32];\n deserialize.bits.raw r128 ([boolean; 256u32]) into r129 ([u128; 2u32]);\n is.eq r2 253u32 into r130;\n cast r85[0u32] r85[1u32] r85[2u32] r85[3u32] r85[4u32] r85[5u32] r85[6u32] r85[7u32] r85[8u32] r85[9u32] r85[10u32] r85[11u32] r85[12u32] r85[13u32] r85[14u32] r85[15u32] r85[16u32] r85[17u32] r85[18u32] r85[19u32] r85[20u32] r85[21u32] r85[22u32] r85[23u32] r85[24u32] r85[25u32] r85[26u32] r85[27u32] r85[28u32] r85[29u32] r85[30u32] r85[31u32] r85[32u32] r85[33u32] r85[34u32] r85[35u32] r85[36u32] r85[37u32] r85[38u32] r85[39u32] r85[40u32] r85[41u32] r85[42u32] r85[43u32] r85[44u32] r85[45u32] r85[46u32] r85[47u32] r85[48u32] r85[49u32] r85[50u32] r85[51u32] r85[52u32] r85[53u32] r85[54u32] r85[55u32] r85[56u32] r85[57u32] r85[58u32] r85[59u32] r85[60u32] r85[61u32] r85[62u32] r85[63u32] r85[64u32] r85[65u32] r85[66u32] r85[67u32] r85[68u32] r85[69u32] r85[70u32] r85[71u32] r85[72u32] r85[73u32] r85[74u32] r85[75u32] r85[76u32] r85[77u32] r85[78u32] r85[79u32] r85[80u32] r85[81u32] r85[82u32] r85[83u32] r85[84u32] r85[85u32] r85[86u32] r85[87u32] r85[88u32] r85[89u32] r85[90u32] r85[91u32] r85[92u32] r85[93u32] r85[94u32] r85[95u32] r85[96u32] r85[97u32] r85[98u32] r85[99u32] r85[100u32] r85[101u32] r85[102u32] r85[103u32] r85[104u32] r85[105u32] r85[106u32] r85[107u32] r85[108u32] r85[109u32] r85[110u32] r85[111u32] r85[112u32] r85[113u32] r85[114u32] r85[115u32] r85[116u32] r85[117u32] r85[118u32] r85[119u32] r85[120u32] r85[121u32] r85[122u32] r85[123u32] r85[124u32] r85[125u32] r85[126u32] r85[127u32] r85[128u32] r85[129u32] r85[130u32] r85[131u32] r85[132u32] r85[133u32] r85[134u32] r85[135u32] r85[136u32] r85[137u32] r85[138u32] r85[139u32] r85[140u32] r85[141u32] r85[142u32] r85[143u32] r85[144u32] r85[145u32] r85[146u32] r85[147u32] r85[148u32] r85[149u32] r85[150u32] r85[151u32] r85[152u32] r85[153u32] r85[154u32] r85[155u32] r85[156u32] r85[157u32] r85[158u32] r85[159u32] r85[160u32] r85[161u32] r85[162u32] r85[163u32] r85[164u32] r85[165u32] r85[166u32] r85[167u32] r85[168u32] r85[169u32] r85[170u32] r85[171u32] r85[172u32] r85[173u32] r85[174u32] r85[175u32] r85[176u32] r85[177u32] r85[178u32] r85[179u32] r85[180u32] r85[181u32] r85[182u32] r85[183u32] r85[184u32] r85[185u32] r85[186u32] r85[187u32] r85[188u32] r85[189u32] r85[190u32] r85[191u32] r85[192u32] r85[193u32] r85[194u32] r85[195u32] r85[196u32] r85[197u32] r85[198u32] r85[199u32] r85[200u32] r85[201u32] r85[202u32] r85[203u32] r85[204u32] r85[205u32] r85[206u32] r85[207u32] r85[208u32] r85[209u32] r85[210u32] r85[211u32] r85[212u32] r85[213u32] r85[214u32] r85[215u32] r85[216u32] r85[217u32] r85[218u32] r85[219u32] r85[220u32] r85[221u32] r85[222u32] r85[223u32] r85[224u32] r85[225u32] r85[226u32] r85[227u32] r85[228u32] r85[229u32] r85[230u32] r85[231u32] r85[232u32] r85[233u32] r85[234u32] r85[235u32] r85[236u32] r85[237u32] r85[238u32] r85[239u32] r85[240u32] r85[241u32] r85[242u32] r85[243u32] r85[244u32] r85[245u32] r85[246u32] r85[247u32] r85[248u32] r85[249u32] r85[250u32] r85[251u32] r85[252u32] into r131 as [u8; 253u32];\n hash.keccak256.native.raw r131 into r132 as [boolean; 256u32];\n deserialize.bits.raw r132 ([boolean; 256u32]) into r133 ([u128; 2u32]);\n is.eq r2 269u32 into r134;\n cast r85[0u32] r85[1u32] r85[2u32] r85[3u32] r85[4u32] r85[5u32] r85[6u32] r85[7u32] r85[8u32] r85[9u32] r85[10u32] r85[11u32] r85[12u32] r85[13u32] r85[14u32] r85[15u32] r85[16u32] r85[17u32] r85[18u32] r85[19u32] r85[20u32] r85[21u32] r85[22u32] r85[23u32] r85[24u32] r85[25u32] r85[26u32] r85[27u32] r85[28u32] r85[29u32] r85[30u32] r85[31u32] r85[32u32] r85[33u32] r85[34u32] r85[35u32] r85[36u32] r85[37u32] r85[38u32] r85[39u32] r85[40u32] r85[41u32] r85[42u32] r85[43u32] r85[44u32] r85[45u32] r85[46u32] r85[47u32] r85[48u32] r85[49u32] r85[50u32] r85[51u32] r85[52u32] r85[53u32] r85[54u32] r85[55u32] r85[56u32] r85[57u32] r85[58u32] r85[59u32] r85[60u32] r85[61u32] r85[62u32] r85[63u32] r85[64u32] r85[65u32] r85[66u32] r85[67u32] r85[68u32] r85[69u32] r85[70u32] r85[71u32] r85[72u32] r85[73u32] r85[74u32] r85[75u32] r85[76u32] r85[77u32] r85[78u32] r85[79u32] r85[80u32] r85[81u32] r85[82u32] r85[83u32] r85[84u32] r85[85u32] r85[86u32] r85[87u32] r85[88u32] r85[89u32] r85[90u32] r85[91u32] r85[92u32] r85[93u32] r85[94u32] r85[95u32] r85[96u32] r85[97u32] r85[98u32] r85[99u32] r85[100u32] r85[101u32] r85[102u32] r85[103u32] r85[104u32] r85[105u32] r85[106u32] r85[107u32] r85[108u32] r85[109u32] r85[110u32] r85[111u32] r85[112u32] r85[113u32] r85[114u32] r85[115u32] r85[116u32] r85[117u32] r85[118u32] r85[119u32] r85[120u32] r85[121u32] r85[122u32] r85[123u32] r85[124u32] r85[125u32] r85[126u32] r85[127u32] r85[128u32] r85[129u32] r85[130u32] r85[131u32] r85[132u32] r85[133u32] r85[134u32] r85[135u32] r85[136u32] r85[137u32] r85[138u32] r85[139u32] r85[140u32] r85[141u32] r85[142u32] r85[143u32] r85[144u32] r85[145u32] r85[146u32] r85[147u32] r85[148u32] r85[149u32] r85[150u32] r85[151u32] r85[152u32] r85[153u32] r85[154u32] r85[155u32] r85[156u32] r85[157u32] r85[158u32] r85[159u32] r85[160u32] r85[161u32] r85[162u32] r85[163u32] r85[164u32] r85[165u32] r85[166u32] r85[167u32] r85[168u32] r85[169u32] r85[170u32] r85[171u32] r85[172u32] r85[173u32] r85[174u32] r85[175u32] r85[176u32] r85[177u32] r85[178u32] r85[179u32] r85[180u32] r85[181u32] r85[182u32] r85[183u32] r85[184u32] r85[185u32] r85[186u32] r85[187u32] r85[188u32] r85[189u32] r85[190u32] r85[191u32] r85[192u32] r85[193u32] r85[194u32] r85[195u32] r85[196u32] r85[197u32] r85[198u32] r85[199u32] r85[200u32] r85[201u32] r85[202u32] r85[203u32] r85[204u32] r85[205u32] r85[206u32] r85[207u32] r85[208u32] r85[209u32] r85[210u32] r85[211u32] r85[212u32] r85[213u32] r85[214u32] r85[215u32] r85[216u32] r85[217u32] r85[218u32] r85[219u32] r85[220u32] r85[221u32] r85[222u32] r85[223u32] r85[224u32] r85[225u32] r85[226u32] r85[227u32] r85[228u32] r85[229u32] r85[230u32] r85[231u32] r85[232u32] r85[233u32] r85[234u32] r85[235u32] r85[236u32] r85[237u32] r85[238u32] r85[239u32] r85[240u32] r85[241u32] r85[242u32] r85[243u32] r85[244u32] r85[245u32] r85[246u32] r85[247u32] r85[248u32] r85[249u32] r85[250u32] r85[251u32] r85[252u32] r85[253u32] r85[254u32] r85[255u32] r85[256u32] r85[257u32] r85[258u32] r85[259u32] r85[260u32] r85[261u32] r85[262u32] r85[263u32] r85[264u32] r85[265u32] r85[266u32] r85[267u32] r85[268u32] into r135 as [u8; 269u32];\n hash.keccak256.native.raw r135 into r136 as [boolean; 256u32];\n deserialize.bits.raw r136 ([boolean; 256u32]) into r137 ([u128; 2u32]);\n is.eq r2 285u32 into r138;\n cast r85[0u32] r85[1u32] r85[2u32] r85[3u32] r85[4u32] r85[5u32] r85[6u32] r85[7u32] r85[8u32] r85[9u32] r85[10u32] r85[11u32] r85[12u32] r85[13u32] r85[14u32] r85[15u32] r85[16u32] r85[17u32] r85[18u32] r85[19u32] r85[20u32] r85[21u32] r85[22u32] r85[23u32] r85[24u32] r85[25u32] r85[26u32] r85[27u32] r85[28u32] r85[29u32] r85[30u32] r85[31u32] r85[32u32] r85[33u32] r85[34u32] r85[35u32] r85[36u32] r85[37u32] r85[38u32] r85[39u32] r85[40u32] r85[41u32] r85[42u32] r85[43u32] r85[44u32] r85[45u32] r85[46u32] r85[47u32] r85[48u32] r85[49u32] r85[50u32] r85[51u32] r85[52u32] r85[53u32] r85[54u32] r85[55u32] r85[56u32] r85[57u32] r85[58u32] r85[59u32] r85[60u32] r85[61u32] r85[62u32] r85[63u32] r85[64u32] r85[65u32] r85[66u32] r85[67u32] r85[68u32] r85[69u32] r85[70u32] r85[71u32] r85[72u32] r85[73u32] r85[74u32] r85[75u32] r85[76u32] r85[77u32] r85[78u32] r85[79u32] r85[80u32] r85[81u32] r85[82u32] r85[83u32] r85[84u32] r85[85u32] r85[86u32] r85[87u32] r85[88u32] r85[89u32] r85[90u32] r85[91u32] r85[92u32] r85[93u32] r85[94u32] r85[95u32] r85[96u32] r85[97u32] r85[98u32] r85[99u32] r85[100u32] r85[101u32] r85[102u32] r85[103u32] r85[104u32] r85[105u32] r85[106u32] r85[107u32] r85[108u32] r85[109u32] r85[110u32] r85[111u32] r85[112u32] r85[113u32] r85[114u32] r85[115u32] r85[116u32] r85[117u32] r85[118u32] r85[119u32] r85[120u32] r85[121u32] r85[122u32] r85[123u32] r85[124u32] r85[125u32] r85[126u32] r85[127u32] r85[128u32] r85[129u32] r85[130u32] r85[131u32] r85[132u32] r85[133u32] r85[134u32] r85[135u32] r85[136u32] r85[137u32] r85[138u32] r85[139u32] r85[140u32] r85[141u32] r85[142u32] r85[143u32] r85[144u32] r85[145u32] r85[146u32] r85[147u32] r85[148u32] r85[149u32] r85[150u32] r85[151u32] r85[152u32] r85[153u32] r85[154u32] r85[155u32] r85[156u32] r85[157u32] r85[158u32] r85[159u32] r85[160u32] r85[161u32] r85[162u32] r85[163u32] r85[164u32] r85[165u32] r85[166u32] r85[167u32] r85[168u32] r85[169u32] r85[170u32] r85[171u32] r85[172u32] r85[173u32] r85[174u32] r85[175u32] r85[176u32] r85[177u32] r85[178u32] r85[179u32] r85[180u32] r85[181u32] r85[182u32] r85[183u32] r85[184u32] r85[185u32] r85[186u32] r85[187u32] r85[188u32] r85[189u32] r85[190u32] r85[191u32] r85[192u32] r85[193u32] r85[194u32] r85[195u32] r85[196u32] r85[197u32] r85[198u32] r85[199u32] r85[200u32] r85[201u32] r85[202u32] r85[203u32] r85[204u32] r85[205u32] r85[206u32] r85[207u32] r85[208u32] r85[209u32] r85[210u32] r85[211u32] r85[212u32] r85[213u32] r85[214u32] r85[215u32] r85[216u32] r85[217u32] r85[218u32] r85[219u32] r85[220u32] r85[221u32] r85[222u32] r85[223u32] r85[224u32] r85[225u32] r85[226u32] r85[227u32] r85[228u32] r85[229u32] r85[230u32] r85[231u32] r85[232u32] r85[233u32] r85[234u32] r85[235u32] r85[236u32] r85[237u32] r85[238u32] r85[239u32] r85[240u32] r85[241u32] r85[242u32] r85[243u32] r85[244u32] r85[245u32] r85[246u32] r85[247u32] r85[248u32] r85[249u32] r85[250u32] r85[251u32] r85[252u32] r85[253u32] r85[254u32] r85[255u32] r85[256u32] r85[257u32] r85[258u32] r85[259u32] r85[260u32] r85[261u32] r85[262u32] r85[263u32] r85[264u32] r85[265u32] r85[266u32] r85[267u32] r85[268u32] r85[269u32] r85[270u32] r85[271u32] r85[272u32] r85[273u32] r85[274u32] r85[275u32] r85[276u32] r85[277u32] r85[278u32] r85[279u32] r85[280u32] r85[281u32] r85[282u32] r85[283u32] r85[284u32] into r139 as [u8; 285u32];\n hash.keccak256.native.raw r139 into r140 as [boolean; 256u32];\n deserialize.bits.raw r140 ([boolean; 256u32]) into r141 ([u128; 2u32]);\n is.eq r2 301u32 into r142;\n cast r85[0u32] r85[1u32] r85[2u32] r85[3u32] r85[4u32] r85[5u32] r85[6u32] r85[7u32] r85[8u32] r85[9u32] r85[10u32] r85[11u32] r85[12u32] r85[13u32] r85[14u32] r85[15u32] r85[16u32] r85[17u32] r85[18u32] r85[19u32] r85[20u32] r85[21u32] r85[22u32] r85[23u32] r85[24u32] r85[25u32] r85[26u32] r85[27u32] r85[28u32] r85[29u32] r85[30u32] r85[31u32] r85[32u32] r85[33u32] r85[34u32] r85[35u32] r85[36u32] r85[37u32] r85[38u32] r85[39u32] r85[40u32] r85[41u32] r85[42u32] r85[43u32] r85[44u32] r85[45u32] r85[46u32] r85[47u32] r85[48u32] r85[49u32] r85[50u32] r85[51u32] r85[52u32] r85[53u32] r85[54u32] r85[55u32] r85[56u32] r85[57u32] r85[58u32] r85[59u32] r85[60u32] r85[61u32] r85[62u32] r85[63u32] r85[64u32] r85[65u32] r85[66u32] r85[67u32] r85[68u32] r85[69u32] r85[70u32] r85[71u32] r85[72u32] r85[73u32] r85[74u32] r85[75u32] r85[76u32] r85[77u32] r85[78u32] r85[79u32] r85[80u32] r85[81u32] r85[82u32] r85[83u32] r85[84u32] r85[85u32] r85[86u32] r85[87u32] r85[88u32] r85[89u32] r85[90u32] r85[91u32] r85[92u32] r85[93u32] r85[94u32] r85[95u32] r85[96u32] r85[97u32] r85[98u32] r85[99u32] r85[100u32] r85[101u32] r85[102u32] r85[103u32] r85[104u32] r85[105u32] r85[106u32] r85[107u32] r85[108u32] r85[109u32] r85[110u32] r85[111u32] r85[112u32] r85[113u32] r85[114u32] r85[115u32] r85[116u32] r85[117u32] r85[118u32] r85[119u32] r85[120u32] r85[121u32] r85[122u32] r85[123u32] r85[124u32] r85[125u32] r85[126u32] r85[127u32] r85[128u32] r85[129u32] r85[130u32] r85[131u32] r85[132u32] r85[133u32] r85[134u32] r85[135u32] r85[136u32] r85[137u32] r85[138u32] r85[139u32] r85[140u32] r85[141u32] r85[142u32] r85[143u32] r85[144u32] r85[145u32] r85[146u32] r85[147u32] r85[148u32] r85[149u32] r85[150u32] r85[151u32] r85[152u32] r85[153u32] r85[154u32] r85[155u32] r85[156u32] r85[157u32] r85[158u32] r85[159u32] r85[160u32] r85[161u32] r85[162u32] r85[163u32] r85[164u32] r85[165u32] r85[166u32] r85[167u32] r85[168u32] r85[169u32] r85[170u32] r85[171u32] r85[172u32] r85[173u32] r85[174u32] r85[175u32] r85[176u32] r85[177u32] r85[178u32] r85[179u32] r85[180u32] r85[181u32] r85[182u32] r85[183u32] r85[184u32] r85[185u32] r85[186u32] r85[187u32] r85[188u32] r85[189u32] r85[190u32] r85[191u32] r85[192u32] r85[193u32] r85[194u32] r85[195u32] r85[196u32] r85[197u32] r85[198u32] r85[199u32] r85[200u32] r85[201u32] r85[202u32] r85[203u32] r85[204u32] r85[205u32] r85[206u32] r85[207u32] r85[208u32] r85[209u32] r85[210u32] r85[211u32] r85[212u32] r85[213u32] r85[214u32] r85[215u32] r85[216u32] r85[217u32] r85[218u32] r85[219u32] r85[220u32] r85[221u32] r85[222u32] r85[223u32] r85[224u32] r85[225u32] r85[226u32] r85[227u32] r85[228u32] r85[229u32] r85[230u32] r85[231u32] r85[232u32] r85[233u32] r85[234u32] r85[235u32] r85[236u32] r85[237u32] r85[238u32] r85[239u32] r85[240u32] r85[241u32] r85[242u32] r85[243u32] r85[244u32] r85[245u32] r85[246u32] r85[247u32] r85[248u32] r85[249u32] r85[250u32] r85[251u32] r85[252u32] r85[253u32] r85[254u32] r85[255u32] r85[256u32] r85[257u32] r85[258u32] r85[259u32] r85[260u32] r85[261u32] r85[262u32] r85[263u32] r85[264u32] r85[265u32] r85[266u32] r85[267u32] r85[268u32] r85[269u32] r85[270u32] r85[271u32] r85[272u32] r85[273u32] r85[274u32] r85[275u32] r85[276u32] r85[277u32] r85[278u32] r85[279u32] r85[280u32] r85[281u32] r85[282u32] r85[283u32] r85[284u32] r85[285u32] r85[286u32] r85[287u32] r85[288u32] r85[289u32] r85[290u32] r85[291u32] r85[292u32] r85[293u32] r85[294u32] r85[295u32] r85[296u32] r85[297u32] r85[298u32] r85[299u32] r85[300u32] into r143 as [u8; 301u32];\n hash.keccak256.native.raw r143 into r144 as [boolean; 256u32];\n deserialize.bits.raw r144 ([boolean; 256u32]) into r145 ([u128; 2u32]);\n is.eq r2 317u32 into r146;\n cast r85[0u32] r85[1u32] r85[2u32] r85[3u32] r85[4u32] r85[5u32] r85[6u32] r85[7u32] r85[8u32] r85[9u32] r85[10u32] r85[11u32] r85[12u32] r85[13u32] r85[14u32] r85[15u32] r85[16u32] r85[17u32] r85[18u32] r85[19u32] r85[20u32] r85[21u32] r85[22u32] r85[23u32] r85[24u32] r85[25u32] r85[26u32] r85[27u32] r85[28u32] r85[29u32] r85[30u32] r85[31u32] r85[32u32] r85[33u32] r85[34u32] r85[35u32] r85[36u32] r85[37u32] r85[38u32] r85[39u32] r85[40u32] r85[41u32] r85[42u32] r85[43u32] r85[44u32] r85[45u32] r85[46u32] r85[47u32] r85[48u32] r85[49u32] r85[50u32] r85[51u32] r85[52u32] r85[53u32] r85[54u32] r85[55u32] r85[56u32] r85[57u32] r85[58u32] r85[59u32] r85[60u32] r85[61u32] r85[62u32] r85[63u32] r85[64u32] r85[65u32] r85[66u32] r85[67u32] r85[68u32] r85[69u32] r85[70u32] r85[71u32] r85[72u32] r85[73u32] r85[74u32] r85[75u32] r85[76u32] r85[77u32] r85[78u32] r85[79u32] r85[80u32] r85[81u32] r85[82u32] r85[83u32] r85[84u32] r85[85u32] r85[86u32] r85[87u32] r85[88u32] r85[89u32] r85[90u32] r85[91u32] r85[92u32] r85[93u32] r85[94u32] r85[95u32] r85[96u32] r85[97u32] r85[98u32] r85[99u32] r85[100u32] r85[101u32] r85[102u32] r85[103u32] r85[104u32] r85[105u32] r85[106u32] r85[107u32] r85[108u32] r85[109u32] r85[110u32] r85[111u32] r85[112u32] r85[113u32] r85[114u32] r85[115u32] r85[116u32] r85[117u32] r85[118u32] r85[119u32] r85[120u32] r85[121u32] r85[122u32] r85[123u32] r85[124u32] r85[125u32] r85[126u32] r85[127u32] r85[128u32] r85[129u32] r85[130u32] r85[131u32] r85[132u32] r85[133u32] r85[134u32] r85[135u32] r85[136u32] r85[137u32] r85[138u32] r85[139u32] r85[140u32] r85[141u32] r85[142u32] r85[143u32] r85[144u32] r85[145u32] r85[146u32] r85[147u32] r85[148u32] r85[149u32] r85[150u32] r85[151u32] r85[152u32] r85[153u32] r85[154u32] r85[155u32] r85[156u32] r85[157u32] r85[158u32] r85[159u32] r85[160u32] r85[161u32] r85[162u32] r85[163u32] r85[164u32] r85[165u32] r85[166u32] r85[167u32] r85[168u32] r85[169u32] r85[170u32] r85[171u32] r85[172u32] r85[173u32] r85[174u32] r85[175u32] r85[176u32] r85[177u32] r85[178u32] r85[179u32] r85[180u32] r85[181u32] r85[182u32] r85[183u32] r85[184u32] r85[185u32] r85[186u32] r85[187u32] r85[188u32] r85[189u32] r85[190u32] r85[191u32] r85[192u32] r85[193u32] r85[194u32] r85[195u32] r85[196u32] r85[197u32] r85[198u32] r85[199u32] r85[200u32] r85[201u32] r85[202u32] r85[203u32] r85[204u32] r85[205u32] r85[206u32] r85[207u32] r85[208u32] r85[209u32] r85[210u32] r85[211u32] r85[212u32] r85[213u32] r85[214u32] r85[215u32] r85[216u32] r85[217u32] r85[218u32] r85[219u32] r85[220u32] r85[221u32] r85[222u32] r85[223u32] r85[224u32] r85[225u32] r85[226u32] r85[227u32] r85[228u32] r85[229u32] r85[230u32] r85[231u32] r85[232u32] r85[233u32] r85[234u32] r85[235u32] r85[236u32] r85[237u32] r85[238u32] r85[239u32] r85[240u32] r85[241u32] r85[242u32] r85[243u32] r85[244u32] r85[245u32] r85[246u32] r85[247u32] r85[248u32] r85[249u32] r85[250u32] r85[251u32] r85[252u32] r85[253u32] r85[254u32] r85[255u32] r85[256u32] r85[257u32] r85[258u32] r85[259u32] r85[260u32] r85[261u32] r85[262u32] r85[263u32] r85[264u32] r85[265u32] r85[266u32] r85[267u32] r85[268u32] r85[269u32] r85[270u32] r85[271u32] r85[272u32] r85[273u32] r85[274u32] r85[275u32] r85[276u32] r85[277u32] r85[278u32] r85[279u32] r85[280u32] r85[281u32] r85[282u32] r85[283u32] r85[284u32] r85[285u32] r85[286u32] r85[287u32] r85[288u32] r85[289u32] r85[290u32] r85[291u32] r85[292u32] r85[293u32] r85[294u32] r85[295u32] r85[296u32] r85[297u32] r85[298u32] r85[299u32] r85[300u32] r85[301u32] r85[302u32] r85[303u32] r85[304u32] r85[305u32] r85[306u32] r85[307u32] r85[308u32] r85[309u32] r85[310u32] r85[311u32] r85[312u32] r85[313u32] r85[314u32] r85[315u32] r85[316u32] into r147 as [u8; 317u32];\n hash.keccak256.native.raw r147 into r148 as [boolean; 256u32];\n deserialize.bits.raw r148 ([boolean; 256u32]) into r149 ([u128; 2u32]);\n is.eq r2 333u32 into r150;\n hash.keccak256.native.raw r85 into r151 as [boolean; 256u32];\n deserialize.bits.raw r151 ([boolean; 256u32]) into r152 ([u128; 2u32]);\n ternary r150 r152[0u32] r19[0u32] into r153;\n ternary r150 r152[1u32] r19[1u32] into r154;\n cast r153 r154 into r155 as [u128; 2u32];\n ternary r146 r149[0u32] r155[0u32] into r156;\n ternary r146 r149[1u32] r155[1u32] into r157;\n cast r156 r157 into r158 as [u128; 2u32];\n ternary r142 r145[0u32] r158[0u32] into r159;\n ternary r142 r145[1u32] r158[1u32] into r160;\n cast r159 r160 into r161 as [u128; 2u32];\n ternary r138 r141[0u32] r161[0u32] into r162;\n ternary r138 r141[1u32] r161[1u32] into r163;\n cast r162 r163 into r164 as [u128; 2u32];\n ternary r134 r137[0u32] r164[0u32] into r165;\n ternary r134 r137[1u32] r164[1u32] into r166;\n cast r165 r166 into r167 as [u128; 2u32];\n ternary r130 r133[0u32] r167[0u32] into r168;\n ternary r130 r133[1u32] r167[1u32] into r169;\n cast r168 r169 into r170 as [u128; 2u32];\n ternary r126 r129[0u32] r170[0u32] into r171;\n ternary r126 r129[1u32] r170[1u32] into r172;\n cast r171 r172 into r173 as [u128; 2u32];\n ternary r122 r125[0u32] r173[0u32] into r174;\n ternary r122 r125[1u32] r173[1u32] into r175;\n cast r174 r175 into r176 as [u128; 2u32];\n ternary r118 r121[0u32] r176[0u32] into r177;\n ternary r118 r121[1u32] r176[1u32] into r178;\n cast r177 r178 into r179 as [u128; 2u32];\n ternary r114 r117[0u32] r179[0u32] into r180;\n ternary r114 r117[1u32] r179[1u32] into r181;\n cast r180 r181 into r182 as [u128; 2u32];\n ternary r110 r113[0u32] r182[0u32] into r183;\n ternary r110 r113[1u32] r182[1u32] into r184;\n cast r183 r184 into r185 as [u128; 2u32];\n ternary r106 r109[0u32] r185[0u32] into r186;\n ternary r106 r109[1u32] r185[1u32] into r187;\n cast r186 r187 into r188 as [u128; 2u32];\n ternary r102 r105[0u32] r188[0u32] into r189;\n ternary r102 r105[1u32] r188[1u32] into r190;\n cast r189 r190 into r191 as [u128; 2u32];\n ternary r98 r101[0u32] r191[0u32] into r192;\n ternary r98 r101[1u32] r191[1u32] into r193;\n cast r192 r193 into r194 as [u128; 2u32];\n ternary r94 r97[0u32] r194[0u32] into r195;\n ternary r94 r97[1u32] r194[1u32] into r196;\n cast r195 r196 into r197 as [u128; 2u32];\n ternary r90 r93[0u32] r197[0u32] into r198;\n ternary r90 r93[1u32] r197[1u32] into r199;\n cast r198 r199 into r200 as [u128; 2u32];\n ternary r86 r89[0u32] r200[0u32] into r201;\n ternary r86 r89[1u32] r200[1u32] into r202;\n cast r201 r202 into r203 as [u128; 2u32];\n cast r85[0u32] r85[1u32] r85[2u32] r85[3u32] r85[4u32] r85[5u32] r85[6u32] r85[7u32] r85[8u32] r85[9u32] r85[10u32] r85[11u32] r85[12u32] r85[13u32] r85[14u32] r85[15u32] r85[16u32] r85[17u32] r85[18u32] r85[19u32] r85[20u32] r85[21u32] r85[22u32] r85[23u32] r85[24u32] r85[25u32] r85[26u32] r85[27u32] r85[28u32] r85[29u32] r85[30u32] r85[31u32] r85[32u32] r85[33u32] r85[34u32] r85[35u32] r85[36u32] r85[37u32] r85[38u32] r85[39u32] r85[40u32] r85[41u32] r85[42u32] r85[43u32] r85[44u32] r85[45u32] r85[46u32] r85[47u32] r85[48u32] r85[49u32] r85[50u32] r85[51u32] r85[52u32] r85[53u32] r85[54u32] r85[55u32] r85[56u32] r85[57u32] r85[58u32] r85[59u32] r85[60u32] r85[61u32] r85[62u32] r85[63u32] r85[64u32] r85[65u32] r85[66u32] r85[67u32] r85[68u32] r85[69u32] r85[70u32] r85[71u32] r85[72u32] r85[73u32] r85[74u32] r85[75u32] r85[76u32] r85[77u32] r85[78u32] r85[79u32] r85[80u32] r85[81u32] r85[82u32] r85[83u32] r85[84u32] r85[85u32] r85[86u32] r85[87u32] r85[88u32] r85[89u32] r85[90u32] r85[91u32] r85[92u32] r85[93u32] r85[94u32] r85[95u32] r85[96u32] r85[97u32] r85[98u32] r85[99u32] r85[100u32] r85[101u32] r85[102u32] r85[103u32] r85[104u32] r85[105u32] r85[106u32] r85[107u32] r85[108u32] r85[109u32] r85[110u32] r85[111u32] r85[112u32] r85[113u32] r85[114u32] r85[115u32] r85[116u32] r85[117u32] r85[118u32] r85[119u32] r85[120u32] r85[121u32] r85[122u32] r85[123u32] r85[124u32] r85[125u32] r85[126u32] r85[127u32] r85[128u32] r85[129u32] r85[130u32] r85[131u32] r85[132u32] r85[133u32] r85[134u32] r85[135u32] r85[136u32] r85[137u32] r85[138u32] r85[139u32] r85[140u32] r85[141u32] r85[142u32] r85[143u32] r85[144u32] r85[145u32] r85[146u32] r85[147u32] r85[148u32] r85[149u32] r85[150u32] r85[151u32] r85[152u32] r85[153u32] r85[154u32] r85[155u32] r85[156u32] r85[157u32] r85[158u32] r85[159u32] r85[160u32] r85[161u32] r85[162u32] r85[163u32] r85[164u32] r85[165u32] r85[166u32] r85[167u32] r85[168u32] r85[169u32] r85[170u32] r85[171u32] r85[172u32] r85[173u32] r85[174u32] r85[175u32] r85[176u32] r85[177u32] r85[178u32] r85[179u32] r85[180u32] r85[181u32] r85[182u32] r85[183u32] r85[184u32] r85[185u32] r85[186u32] r85[187u32] r85[188u32] r85[189u32] r85[190u32] r85[191u32] r85[192u32] r85[193u32] r85[194u32] r85[195u32] r85[196u32] r85[197u32] r85[198u32] r85[199u32] r85[200u32] r85[201u32] r85[202u32] r85[203u32] r85[204u32] r85[205u32] into r204 as [u8; 206u32];\n hash.keccak256.native.raw r204 into r205 as [boolean; 256u32];\n deserialize.bits.raw r205 ([boolean; 256u32]) into r206 ([u128; 2u32]);\n cast r85[0u32] r85[1u32] r85[2u32] r85[3u32] r85[4u32] r85[5u32] r85[6u32] r85[7u32] r85[8u32] r85[9u32] r85[10u32] r85[11u32] r85[12u32] r85[13u32] r85[14u32] r85[15u32] r85[16u32] r85[17u32] r85[18u32] r85[19u32] r85[20u32] r85[21u32] r85[22u32] r85[23u32] r85[24u32] r85[25u32] r85[26u32] r85[27u32] r85[28u32] r85[29u32] r85[30u32] r85[31u32] r85[32u32] r85[33u32] r85[34u32] r85[35u32] r85[36u32] r85[37u32] r85[38u32] r85[39u32] r85[40u32] r85[41u32] r85[42u32] r85[43u32] r85[44u32] r85[45u32] r85[46u32] r85[47u32] r85[48u32] r85[49u32] r85[50u32] r85[51u32] r85[52u32] r85[53u32] r85[54u32] r85[55u32] r85[56u32] r85[57u32] r85[58u32] r85[59u32] r85[60u32] r85[61u32] r85[62u32] r85[63u32] r85[64u32] r85[65u32] r85[66u32] r85[67u32] r85[68u32] r85[69u32] r85[70u32] r85[71u32] r85[72u32] r85[73u32] r85[74u32] r85[75u32] r85[76u32] r85[77u32] r85[78u32] r85[79u32] r85[80u32] r85[81u32] r85[82u32] r85[83u32] r85[84u32] r85[85u32] r85[86u32] r85[87u32] r85[88u32] r85[89u32] r85[90u32] r85[91u32] r85[92u32] r85[93u32] r85[94u32] r85[95u32] r85[96u32] r85[97u32] r85[98u32] r85[99u32] r85[100u32] r85[101u32] r85[102u32] r85[103u32] r85[104u32] r85[105u32] r85[106u32] r85[107u32] r85[108u32] r85[109u32] r85[110u32] r85[111u32] r85[112u32] r85[113u32] r85[114u32] r85[115u32] r85[116u32] r85[117u32] r85[118u32] r85[119u32] r85[120u32] r85[121u32] r85[122u32] r85[123u32] r85[124u32] r85[125u32] r85[126u32] r85[127u32] r85[128u32] r85[129u32] r85[130u32] r85[131u32] r85[132u32] r85[133u32] r85[134u32] r85[135u32] r85[136u32] r85[137u32] r85[138u32] r85[139u32] r85[140u32] r85[141u32] r85[142u32] r85[143u32] r85[144u32] r85[145u32] r85[146u32] r85[147u32] r85[148u32] into r207 as [u8; 149u32];\n hash.keccak256.native.raw r207 into r208 as [boolean; 256u32];\n deserialize.bits.raw r208 ([boolean; 256u32]) into r209 ([u128; 2u32]);\n cast r85[0u32] r85[1u32] r85[2u32] r85[3u32] r85[4u32] r85[5u32] r85[6u32] r85[7u32] r85[8u32] r85[9u32] r85[10u32] r85[11u32] r85[12u32] r85[13u32] r85[14u32] r85[15u32] r85[16u32] r85[17u32] r85[18u32] r85[19u32] r85[20u32] r85[21u32] r85[22u32] r85[23u32] r85[24u32] r85[25u32] r85[26u32] r85[27u32] r85[28u32] r85[29u32] r85[30u32] r85[31u32] r85[32u32] r85[33u32] r85[34u32] r85[35u32] r85[36u32] r85[37u32] r85[38u32] r85[39u32] r85[40u32] r85[41u32] r85[42u32] r85[43u32] r85[44u32] r85[45u32] r85[46u32] r85[47u32] r85[48u32] r85[49u32] r85[50u32] r85[51u32] r85[52u32] r85[53u32] r85[54u32] r85[55u32] r85[56u32] r85[57u32] r85[58u32] r85[59u32] r85[60u32] r85[61u32] r85[62u32] r85[63u32] r85[64u32] r85[65u32] r85[66u32] r85[67u32] r85[68u32] r85[69u32] r85[70u32] r85[71u32] r85[72u32] r85[73u32] r85[74u32] r85[75u32] r85[76u32] r85[77u32] r85[78u32] r85[79u32] r85[80u32] r85[81u32] r85[82u32] r85[83u32] r85[84u32] r85[85u32] r85[86u32] r85[87u32] r85[88u32] r85[89u32] r85[90u32] r85[91u32] r85[92u32] r85[93u32] r85[94u32] r85[95u32] r85[96u32] r85[97u32] r85[98u32] r85[99u32] r85[100u32] r85[101u32] r85[102u32] r85[103u32] r85[104u32] r85[105u32] r85[106u32] r85[107u32] r85[108u32] r85[109u32] r85[110u32] r85[111u32] r85[112u32] r85[113u32] r85[114u32] r85[115u32] r85[116u32] r85[117u32] r85[118u32] r85[119u32] r85[120u32] r85[121u32] r85[122u32] r85[123u32] r85[124u32] r85[125u32] r85[126u32] r85[127u32] r85[128u32] r85[129u32] r85[130u32] r85[131u32] r85[132u32] r85[133u32] r85[134u32] r85[135u32] r85[136u32] r85[137u32] r85[138u32] r85[139u32] r85[140u32] r85[141u32] r85[142u32] r85[143u32] r85[144u32] r85[145u32] r85[146u32] r85[147u32] r85[148u32] r85[149u32] r85[150u32] r85[151u32] r85[152u32] r85[153u32] r85[154u32] r85[155u32] r85[156u32] r85[157u32] r85[158u32] r85[159u32] r85[160u32] r85[161u32] r85[162u32] r85[163u32] r85[164u32] r85[165u32] r85[166u32] into r210 as [u8; 167u32];\n hash.keccak256.native.raw r210 into r211 as [boolean; 256u32];\n deserialize.bits.raw r211 ([boolean; 256u32]) into r212 ([u128; 2u32]);\n ternary r17 r212[0u32] r203[0u32] into r213;\n ternary r17 r212[1u32] r203[1u32] into r214;\n cast r213 r214 into r215 as [u128; 2u32];\n ternary r15 r209[0u32] r215[0u32] into r216;\n ternary r15 r209[1u32] r215[1u32] into r217;\n cast r216 r217 into r218 as [u128; 2u32];\n ternary r13 r206[0u32] r218[0u32] into r219;\n ternary r13 r206[1u32] r218[1u32] into r220;\n cast r219 r220 into r221 as [u128; 2u32];\n assert.eq r221 r3;\n get mailbox[true] into r222;\n await r5;\n serialize.bits.raw r4 (address) into r223 ([boolean; 253u32]);\n cast false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false into r224 as [boolean; 256u32];\n cast r223[0u32] r223[1u32] r223[2u32] r223[3u32] r223[4u32] r223[5u32] r223[6u32] r223[7u32] r223[8u32] r223[9u32] r223[10u32] r223[11u32] r223[12u32] r223[13u32] r223[14u32] r223[15u32] r223[16u32] r223[17u32] r223[18u32] r223[19u32] r223[20u32] r223[21u32] r223[22u32] r223[23u32] r223[24u32] r223[25u32] r223[26u32] r223[27u32] r223[28u32] r223[29u32] r223[30u32] r223[31u32] r223[32u32] r223[33u32] r223[34u32] r223[35u32] r223[36u32] r223[37u32] r223[38u32] r223[39u32] r223[40u32] r223[41u32] r223[42u32] r223[43u32] r223[44u32] r223[45u32] r223[46u32] r223[47u32] r223[48u32] r223[49u32] r223[50u32] r223[51u32] r223[52u32] r223[53u32] r223[54u32] r223[55u32] r223[56u32] r223[57u32] r223[58u32] r223[59u32] r223[60u32] r223[61u32] r223[62u32] r223[63u32] r223[64u32] r223[65u32] r223[66u32] r223[67u32] r223[68u32] r223[69u32] r223[70u32] r223[71u32] r223[72u32] r223[73u32] r223[74u32] r223[75u32] r223[76u32] r223[77u32] r223[78u32] r223[79u32] r223[80u32] r223[81u32] r223[82u32] r223[83u32] r223[84u32] r223[85u32] r223[86u32] r223[87u32] r223[88u32] r223[89u32] r223[90u32] r223[91u32] r223[92u32] r223[93u32] r223[94u32] r223[95u32] r223[96u32] r223[97u32] r223[98u32] r223[99u32] r223[100u32] r223[101u32] r223[102u32] r223[103u32] r223[104u32] r223[105u32] r223[106u32] r223[107u32] r223[108u32] r223[109u32] r223[110u32] r223[111u32] r223[112u32] r223[113u32] r223[114u32] r223[115u32] r223[116u32] r223[117u32] r223[118u32] r223[119u32] r223[120u32] r223[121u32] r223[122u32] r223[123u32] r223[124u32] r223[125u32] r223[126u32] r223[127u32] r223[128u32] r223[129u32] r223[130u32] r223[131u32] r223[132u32] r223[133u32] r223[134u32] r223[135u32] r223[136u32] r223[137u32] r223[138u32] r223[139u32] r223[140u32] r223[141u32] r223[142u32] r223[143u32] r223[144u32] r223[145u32] r223[146u32] r223[147u32] r223[148u32] r223[149u32] r223[150u32] r223[151u32] r223[152u32] r223[153u32] r223[154u32] r223[155u32] r223[156u32] r223[157u32] r223[158u32] r223[159u32] r223[160u32] r223[161u32] r223[162u32] r223[163u32] r223[164u32] r223[165u32] r223[166u32] r223[167u32] r223[168u32] r223[169u32] r223[170u32] r223[171u32] r223[172u32] r223[173u32] r223[174u32] r223[175u32] r223[176u32] r223[177u32] r223[178u32] r223[179u32] r223[180u32] r223[181u32] r223[182u32] r223[183u32] r223[184u32] r223[185u32] r223[186u32] r223[187u32] r223[188u32] r223[189u32] r223[190u32] r223[191u32] r223[192u32] r223[193u32] r223[194u32] r223[195u32] r223[196u32] r223[197u32] r223[198u32] r223[199u32] r223[200u32] r223[201u32] r223[202u32] r223[203u32] r223[204u32] r223[205u32] r223[206u32] r223[207u32] r223[208u32] r223[209u32] r223[210u32] r223[211u32] r223[212u32] r223[213u32] r223[214u32] r223[215u32] r223[216u32] r223[217u32] r223[218u32] r223[219u32] r223[220u32] r223[221u32] r223[222u32] r223[223u32] r223[224u32] r223[225u32] r223[226u32] r223[227u32] r223[228u32] r223[229u32] r223[230u32] r223[231u32] r223[232u32] r223[233u32] r223[234u32] r223[235u32] r223[236u32] r223[237u32] r223[238u32] r223[239u32] r223[240u32] r223[241u32] r223[242u32] r223[243u32] r223[244u32] r223[245u32] r223[246u32] r223[247u32] r223[248u32] r223[249u32] r223[250u32] r223[251u32] r223[252u32] r224[253u32] r224[254u32] r224[255u32] into r225 as [boolean; 256u32];\n deserialize.bits.raw r225 ([boolean; 256u32]) into r226 ([u8; 32u32]);\n assert.eq r1.recipient r226;\n assert.eq r1.version 3u8;\n assert.eq r1.destination_domain r222.local_domain;\n cast r3 into r227 as DeliveryKey;\n contains deliveries[r227] into r228;\n not r228 into r229;\n assert.eq r229 true;\n cast r4 block.height into r230 as Delivery;\n set r230 into deliveries[r227];\n set r3 into process_events[r222.process_count];\n set r222.process_count into process_event_index[block.height];\n add r222.process_count 1u32 into r231;\n cast r222.local_domain r222.nonce r231 r222.default_ism r222.default_hook r222.required_hook r222.dispatch_proxy r222.mailbox_owner into r232 as Mailbox;\n set r232 into mailbox[true];\n\nfunction dispatch:\n input r0 as u32.public;\n input r1 as [u8; 32u32].public;\n input r2 as [u128; 16u32].public;\n input r3 as address.public;\n async dispatch r0 r1 r2 r3 self.caller into r4;\n output r4 as mailbox.aleo/dispatch.future;\n\nfinalize dispatch:\n input r0 as u32.public;\n input r1 as [u8; 32u32].public;\n input r2 as [u128; 16u32].public;\n input r3 as address.public;\n input r4 as address.public;\n contains mailbox[true] into r5;\n assert.eq r5 true;\n get mailbox[true] into r6;\n assert.eq r4 r6.dispatch_proxy;\n serialize.bits.raw r3 (address) into r7 ([boolean; 253u32]);\n cast false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false into r8 as [boolean; 256u32];\n cast r7[0u32] r7[1u32] r7[2u32] r7[3u32] r7[4u32] r7[5u32] r7[6u32] r7[7u32] r7[8u32] r7[9u32] r7[10u32] r7[11u32] r7[12u32] r7[13u32] r7[14u32] r7[15u32] r7[16u32] r7[17u32] r7[18u32] r7[19u32] r7[20u32] r7[21u32] r7[22u32] r7[23u32] r7[24u32] r7[25u32] r7[26u32] r7[27u32] r7[28u32] r7[29u32] r7[30u32] r7[31u32] r7[32u32] r7[33u32] r7[34u32] r7[35u32] r7[36u32] r7[37u32] r7[38u32] r7[39u32] r7[40u32] r7[41u32] r7[42u32] r7[43u32] r7[44u32] r7[45u32] r7[46u32] r7[47u32] r7[48u32] r7[49u32] r7[50u32] r7[51u32] r7[52u32] r7[53u32] r7[54u32] r7[55u32] r7[56u32] r7[57u32] r7[58u32] r7[59u32] r7[60u32] r7[61u32] r7[62u32] r7[63u32] r7[64u32] r7[65u32] r7[66u32] r7[67u32] r7[68u32] r7[69u32] r7[70u32] r7[71u32] r7[72u32] r7[73u32] r7[74u32] r7[75u32] r7[76u32] r7[77u32] r7[78u32] r7[79u32] r7[80u32] r7[81u32] r7[82u32] r7[83u32] r7[84u32] r7[85u32] r7[86u32] r7[87u32] r7[88u32] r7[89u32] r7[90u32] r7[91u32] r7[92u32] r7[93u32] r7[94u32] r7[95u32] r7[96u32] r7[97u32] r7[98u32] r7[99u32] r7[100u32] r7[101u32] r7[102u32] r7[103u32] r7[104u32] r7[105u32] r7[106u32] r7[107u32] r7[108u32] r7[109u32] r7[110u32] r7[111u32] r7[112u32] r7[113u32] r7[114u32] r7[115u32] r7[116u32] r7[117u32] r7[118u32] r7[119u32] r7[120u32] r7[121u32] r7[122u32] r7[123u32] r7[124u32] r7[125u32] r7[126u32] r7[127u32] r7[128u32] r7[129u32] r7[130u32] r7[131u32] r7[132u32] r7[133u32] r7[134u32] r7[135u32] r7[136u32] r7[137u32] r7[138u32] r7[139u32] r7[140u32] r7[141u32] r7[142u32] r7[143u32] r7[144u32] r7[145u32] r7[146u32] r7[147u32] r7[148u32] r7[149u32] r7[150u32] r7[151u32] r7[152u32] r7[153u32] r7[154u32] r7[155u32] r7[156u32] r7[157u32] r7[158u32] r7[159u32] r7[160u32] r7[161u32] r7[162u32] r7[163u32] r7[164u32] r7[165u32] r7[166u32] r7[167u32] r7[168u32] r7[169u32] r7[170u32] r7[171u32] r7[172u32] r7[173u32] r7[174u32] r7[175u32] r7[176u32] r7[177u32] r7[178u32] r7[179u32] r7[180u32] r7[181u32] r7[182u32] r7[183u32] r7[184u32] r7[185u32] r7[186u32] r7[187u32] r7[188u32] r7[189u32] r7[190u32] r7[191u32] r7[192u32] r7[193u32] r7[194u32] r7[195u32] r7[196u32] r7[197u32] r7[198u32] r7[199u32] r7[200u32] r7[201u32] r7[202u32] r7[203u32] r7[204u32] r7[205u32] r7[206u32] r7[207u32] r7[208u32] r7[209u32] r7[210u32] r7[211u32] r7[212u32] r7[213u32] r7[214u32] r7[215u32] r7[216u32] r7[217u32] r7[218u32] r7[219u32] r7[220u32] r7[221u32] r7[222u32] r7[223u32] r7[224u32] r7[225u32] r7[226u32] r7[227u32] r7[228u32] r7[229u32] r7[230u32] r7[231u32] r7[232u32] r7[233u32] r7[234u32] r7[235u32] r7[236u32] r7[237u32] r7[238u32] r7[239u32] r7[240u32] r7[241u32] r7[242u32] r7[243u32] r7[244u32] r7[245u32] r7[246u32] r7[247u32] r7[248u32] r7[249u32] r7[250u32] r7[251u32] r7[252u32] r8[253u32] r8[254u32] r8[255u32] into r9 as [boolean; 256u32];\n deserialize.bits.raw r9 ([boolean; 256u32]) into r10 ([u8; 32u32]);\n cast 3u8 r6.nonce r6.local_domain r10 r0 r1 r2 into r11 as Message;\n shr r11.nonce 24u32 into r12;\n cast r12 into r13 as u8;\n shr r11.nonce 16u32 into r14;\n rem r14 256u32 into r15;\n cast r15 into r16 as u8;\n shr r11.nonce 8u32 into r17;\n rem r17 256u32 into r18;\n cast r18 into r19 as u8;\n rem r11.nonce 256u32 into r20;\n cast r20 into r21 as u8;\n cast r13 r16 r19 r21 into r22 as [u8; 4u32];\n shr r11.origin_domain 24u32 into r23;\n cast r23 into r24 as u8;\n shr r11.origin_domain 16u32 into r25;\n rem r25 256u32 into r26;\n cast r26 into r27 as u8;\n shr r11.origin_domain 8u32 into r28;\n rem r28 256u32 into r29;\n cast r29 into r30 as u8;\n rem r11.origin_domain 256u32 into r31;\n cast r31 into r32 as u8;\n cast r24 r27 r30 r32 into r33 as [u8; 4u32];\n shr r11.destination_domain 24u32 into r34;\n cast r34 into r35 as u8;\n shr r11.destination_domain 16u32 into r36;\n rem r36 256u32 into r37;\n cast r37 into r38 as u8;\n shr r11.destination_domain 8u32 into r39;\n rem r39 256u32 into r40;\n cast r40 into r41 as u8;\n rem r11.destination_domain 256u32 into r42;\n cast r42 into r43 as u8;\n cast r35 r38 r41 r43 into r44 as [u8; 4u32];\n serialize.bits.raw r11.body[0u32] (u128) into r45 ([boolean; 128u32]);\n deserialize.bits.raw r45 ([boolean; 128u32]) into r46 ([u8; 16u32]);\n serialize.bits.raw r11.body[1u32] (u128) into r47 ([boolean; 128u32]);\n deserialize.bits.raw r47 ([boolean; 128u32]) into r48 ([u8; 16u32]);\n serialize.bits.raw r11.body[2u32] (u128) into r49 ([boolean; 128u32]);\n deserialize.bits.raw r49 ([boolean; 128u32]) into r50 ([u8; 16u32]);\n serialize.bits.raw r11.body[3u32] (u128) into r51 ([boolean; 128u32]);\n deserialize.bits.raw r51 ([boolean; 128u32]) into r52 ([u8; 16u32]);\n serialize.bits.raw r11.body[4u32] (u128) into r53 ([boolean; 128u32]);\n deserialize.bits.raw r53 ([boolean; 128u32]) into r54 ([u8; 16u32]);\n serialize.bits.raw r11.body[5u32] (u128) into r55 ([boolean; 128u32]);\n deserialize.bits.raw r55 ([boolean; 128u32]) into r56 ([u8; 16u32]);\n serialize.bits.raw r11.body[6u32] (u128) into r57 ([boolean; 128u32]);\n deserialize.bits.raw r57 ([boolean; 128u32]) into r58 ([u8; 16u32]);\n serialize.bits.raw r11.body[7u32] (u128) into r59 ([boolean; 128u32]);\n deserialize.bits.raw r59 ([boolean; 128u32]) into r60 ([u8; 16u32]);\n serialize.bits.raw r11.body[8u32] (u128) into r61 ([boolean; 128u32]);\n deserialize.bits.raw r61 ([boolean; 128u32]) into r62 ([u8; 16u32]);\n serialize.bits.raw r11.body[9u32] (u128) into r63 ([boolean; 128u32]);\n deserialize.bits.raw r63 ([boolean; 128u32]) into r64 ([u8; 16u32]);\n serialize.bits.raw r11.body[10u32] (u128) into r65 ([boolean; 128u32]);\n deserialize.bits.raw r65 ([boolean; 128u32]) into r66 ([u8; 16u32]);\n serialize.bits.raw r11.body[11u32] (u128) into r67 ([boolean; 128u32]);\n deserialize.bits.raw r67 ([boolean; 128u32]) into r68 ([u8; 16u32]);\n serialize.bits.raw r11.body[12u32] (u128) into r69 ([boolean; 128u32]);\n deserialize.bits.raw r69 ([boolean; 128u32]) into r70 ([u8; 16u32]);\n serialize.bits.raw r11.body[13u32] (u128) into r71 ([boolean; 128u32]);\n deserialize.bits.raw r71 ([boolean; 128u32]) into r72 ([u8; 16u32]);\n serialize.bits.raw r11.body[14u32] (u128) into r73 ([boolean; 128u32]);\n deserialize.bits.raw r73 ([boolean; 128u32]) into r74 ([u8; 16u32]);\n serialize.bits.raw r11.body[15u32] (u128) into r75 ([boolean; 128u32]);\n deserialize.bits.raw r75 ([boolean; 128u32]) into r76 ([u8; 16u32]);\n cast r11.version r22[0u32] r22[1u32] r22[2u32] r22[3u32] r33[0u32] r33[1u32] r33[2u32] r33[3u32] r11.sender[0u32] r11.sender[1u32] r11.sender[2u32] r11.sender[3u32] r11.sender[4u32] r11.sender[5u32] r11.sender[6u32] r11.sender[7u32] r11.sender[8u32] r11.sender[9u32] r11.sender[10u32] r11.sender[11u32] r11.sender[12u32] r11.sender[13u32] r11.sender[14u32] r11.sender[15u32] r11.sender[16u32] r11.sender[17u32] r11.sender[18u32] r11.sender[19u32] r11.sender[20u32] r11.sender[21u32] r11.sender[22u32] r11.sender[23u32] r11.sender[24u32] r11.sender[25u32] r11.sender[26u32] r11.sender[27u32] r11.sender[28u32] r11.sender[29u32] r11.sender[30u32] r11.sender[31u32] r44[0u32] r44[1u32] r44[2u32] r44[3u32] r11.recipient[0u32] r11.recipient[1u32] r11.recipient[2u32] r11.recipient[3u32] r11.recipient[4u32] r11.recipient[5u32] r11.recipient[6u32] r11.recipient[7u32] r11.recipient[8u32] r11.recipient[9u32] r11.recipient[10u32] r11.recipient[11u32] r11.recipient[12u32] r11.recipient[13u32] r11.recipient[14u32] r11.recipient[15u32] r11.recipient[16u32] r11.recipient[17u32] r11.recipient[18u32] r11.recipient[19u32] r11.recipient[20u32] r11.recipient[21u32] r11.recipient[22u32] r11.recipient[23u32] r11.recipient[24u32] r11.recipient[25u32] r11.recipient[26u32] r11.recipient[27u32] r11.recipient[28u32] r11.recipient[29u32] r11.recipient[30u32] r11.recipient[31u32] r46[0u32] r46[1u32] r46[2u32] r46[3u32] r46[4u32] r46[5u32] r46[6u32] r46[7u32] r46[8u32] r46[9u32] r46[10u32] r46[11u32] r46[12u32] r46[13u32] r46[14u32] r46[15u32] r48[0u32] r48[1u32] r48[2u32] r48[3u32] r48[4u32] r48[5u32] r48[6u32] r48[7u32] r48[8u32] r48[9u32] r48[10u32] r48[11u32] r48[12u32] r48[13u32] r48[14u32] r48[15u32] r50[0u32] r50[1u32] r50[2u32] r50[3u32] r50[4u32] r50[5u32] r50[6u32] r50[7u32] r50[8u32] r50[9u32] r50[10u32] r50[11u32] r50[12u32] r50[13u32] r50[14u32] r50[15u32] r52[0u32] r52[1u32] r52[2u32] r52[3u32] r52[4u32] r52[5u32] r52[6u32] r52[7u32] r52[8u32] r52[9u32] r52[10u32] r52[11u32] r52[12u32] r52[13u32] r52[14u32] r52[15u32] r54[0u32] r54[1u32] r54[2u32] r54[3u32] r54[4u32] r54[5u32] r54[6u32] r54[7u32] r54[8u32] r54[9u32] r54[10u32] r54[11u32] r54[12u32] r54[13u32] r54[14u32] r54[15u32] r56[0u32] r56[1u32] r56[2u32] r56[3u32] r56[4u32] r56[5u32] r56[6u32] r56[7u32] r56[8u32] r56[9u32] r56[10u32] r56[11u32] r56[12u32] r56[13u32] r56[14u32] r56[15u32] r58[0u32] r58[1u32] r58[2u32] r58[3u32] r58[4u32] r58[5u32] r58[6u32] r58[7u32] r58[8u32] r58[9u32] r58[10u32] r58[11u32] r58[12u32] r58[13u32] r58[14u32] r58[15u32] r60[0u32] r60[1u32] r60[2u32] r60[3u32] r60[4u32] r60[5u32] r60[6u32] r60[7u32] r60[8u32] r60[9u32] r60[10u32] r60[11u32] r60[12u32] r60[13u32] r60[14u32] r60[15u32] r62[0u32] r62[1u32] r62[2u32] r62[3u32] r62[4u32] r62[5u32] r62[6u32] r62[7u32] r62[8u32] r62[9u32] r62[10u32] r62[11u32] r62[12u32] r62[13u32] r62[14u32] r62[15u32] r64[0u32] r64[1u32] r64[2u32] r64[3u32] r64[4u32] r64[5u32] r64[6u32] r64[7u32] r64[8u32] r64[9u32] r64[10u32] r64[11u32] r64[12u32] r64[13u32] r64[14u32] r64[15u32] r66[0u32] r66[1u32] r66[2u32] r66[3u32] r66[4u32] r66[5u32] r66[6u32] r66[7u32] r66[8u32] r66[9u32] r66[10u32] r66[11u32] r66[12u32] r66[13u32] r66[14u32] r66[15u32] r68[0u32] r68[1u32] r68[2u32] r68[3u32] r68[4u32] r68[5u32] r68[6u32] r68[7u32] r68[8u32] r68[9u32] r68[10u32] r68[11u32] r68[12u32] r68[13u32] r68[14u32] r68[15u32] r70[0u32] r70[1u32] r70[2u32] r70[3u32] r70[4u32] r70[5u32] r70[6u32] r70[7u32] r70[8u32] r70[9u32] r70[10u32] r70[11u32] r70[12u32] r70[13u32] r70[14u32] r70[15u32] r72[0u32] r72[1u32] r72[2u32] r72[3u32] r72[4u32] r72[5u32] r72[6u32] r72[7u32] r72[8u32] r72[9u32] r72[10u32] r72[11u32] r72[12u32] r72[13u32] r72[14u32] r72[15u32] r74[0u32] r74[1u32] r74[2u32] r74[3u32] r74[4u32] r74[5u32] r74[6u32] r74[7u32] r74[8u32] r74[9u32] r74[10u32] r74[11u32] r74[12u32] r74[13u32] r74[14u32] r74[15u32] r76[0u32] r76[1u32] r76[2u32] r76[3u32] r76[4u32] r76[5u32] r76[6u32] r76[7u32] r76[8u32] r76[9u32] r76[10u32] r76[11u32] r76[12u32] r76[13u32] r76[14u32] r76[15u32] into r77 as [u8; 333u32];\n hash.keccak256.native.raw r77 into r78 as [boolean; 256u32];\n deserialize.bits.raw r78 ([boolean; 256u32]) into r79 ([u128; 2u32]);\n set r11 into dispatch_events[r6.nonce];\n set r79 into dispatch_id_events[r6.nonce];\n set r6.nonce into dispatch_event_index[block.height];\n add r6.nonce 1u32 into r80;\n cast r6.local_domain r80 r6.process_count r6.default_ism r6.default_hook r6.required_hook r6.dispatch_proxy r6.mailbox_owner into r81 as Mailbox;\n set r81 into mailbox[true];\n\nconstructor:\n assert.eq edition 0u16;\n`;
20
+ const token_registry = `import credits.aleo;\nprogram token_registry.aleo;\n\n\nrecord Token:\n owner as address.private;\n amount as u128.private;\n token_id as field.private;\n external_authorization_required as boolean.private;\n authorized_until as u32.private;\n\nstruct TokenMetadata:\n token_id as field;\n name as u128;\n symbol as u128;\n decimals as u8;\n supply as u128;\n max_supply as u128;\n admin as address;\n external_authorization_required as boolean;\n external_authorization_party as address;\n\nstruct TokenOwner:\n account as address;\n token_id as field;\n\nstruct Balance:\n token_id as field;\n account as address;\n balance as u128;\n authorized_until as u32;\n\nstruct Allowance:\n account as address;\n spender as address;\n token_id as field;\n\n\nmapping registered_tokens:\n key as field.public;\n value as TokenMetadata.public;\n\n\nmapping balances:\n key as field.public;\n value as Balance.public;\n\n\nmapping authorized_balances:\n key as field.public;\n value as Balance.public;\n\n\nmapping allowances:\n key as field.public;\n value as u128.public;\n\n\nmapping roles:\n key as field.public;\n value as u8.public;\n\n\nfunction transfer_public:\n input r0 as field.public;\n input r1 as address.public;\n input r2 as u128.public;\n cast self.caller r0 into r3 as TokenOwner;\n hash.bhp256 r3 into r4 as field;\n cast r1 r0 into r5 as TokenOwner;\n hash.bhp256 r5 into r6 as field;\n async transfer_public r0 r1 r2 self.caller r4 r6 into r7;\n output r7 as token_registry.aleo/transfer_public.future;\n\nfinalize transfer_public:\n input r0 as field.public;\n input r1 as address.public;\n input r2 as u128.public;\n input r3 as address.public;\n input r4 as field.public;\n input r5 as field.public;\n get authorized_balances[r4] into r6;\n get registered_tokens[r0] into r7;\n lte block.height r6.authorized_until into r8;\n not r7.external_authorization_required into r9;\n or r8 r9 into r10;\n assert.eq r10 true;\n sub r6.balance r2 into r11;\n cast r0 r3 r11 r6.authorized_until into r12 as Balance;\n set r12 into authorized_balances[r4];\n get registered_tokens[r0] into r13;\n ternary r13.external_authorization_required 0u32 4294967295u32 into r14;\n cast r0 r1 0u128 r14 into r15 as Balance;\n get.or_use balances[r5] r15 into r16;\n get.or_use authorized_balances[r5] r15 into r17;\n ternary r13.external_authorization_required r16.token_id r17.token_id into r18;\n ternary r13.external_authorization_required r16.account r17.account into r19;\n ternary r13.external_authorization_required r16.balance r17.balance into r20;\n ternary r13.external_authorization_required r16.authorized_until r17.authorized_until into r21;\n cast r18 r19 r20 r21 into r22 as Balance;\n add r22.balance r2 into r23;\n cast r0 r1 r23 r22.authorized_until into r24 as Balance;\n branch.eq r13.external_authorization_required false to end_then_0_0;\n set r24 into balances[r5];\n branch.eq true true to end_otherwise_0_1;\n position end_then_0_0;\n set r24 into authorized_balances[r5];\n position end_otherwise_0_1;\n\n\n\n\nfunction transfer_public_as_signer:\n input r0 as field.public;\n input r1 as address.public;\n input r2 as u128.public;\n cast self.signer r0 into r3 as TokenOwner;\n hash.bhp256 r3 into r4 as field;\n cast r1 r0 into r5 as TokenOwner;\n hash.bhp256 r5 into r6 as field;\n async transfer_public_as_signer r0 r1 r2 self.signer r4 r6 into r7;\n output r7 as token_registry.aleo/transfer_public_as_signer.future;\n\nfinalize transfer_public_as_signer:\n input r0 as field.public;\n input r1 as address.public;\n input r2 as u128.public;\n input r3 as address.public;\n input r4 as field.public;\n input r5 as field.public;\n get authorized_balances[r4] into r6;\n get registered_tokens[r0] into r7;\n lte block.height r6.authorized_until into r8;\n not r7.external_authorization_required into r9;\n or r8 r9 into r10;\n assert.eq r10 true;\n sub r6.balance r2 into r11;\n cast r0 r3 r11 r6.authorized_until into r12 as Balance;\n set r12 into authorized_balances[r4];\n get registered_tokens[r0] into r13;\n ternary r13.external_authorization_required 0u32 4294967295u32 into r14;\n cast r0 r1 0u128 r14 into r15 as Balance;\n get.or_use balances[r5] r15 into r16;\n get.or_use authorized_balances[r5] r15 into r17;\n ternary r13.external_authorization_required r16.token_id r17.token_id into r18;\n ternary r13.external_authorization_required r16.account r17.account into r19;\n ternary r13.external_authorization_required r16.balance r17.balance into r20;\n ternary r13.external_authorization_required r16.authorized_until r17.authorized_until into r21;\n cast r18 r19 r20 r21 into r22 as Balance;\n add r22.balance r2 into r23;\n cast r0 r1 r23 r22.authorized_until into r24 as Balance;\n branch.eq r13.external_authorization_required false to end_then_0_2;\n set r24 into balances[r5];\n branch.eq true true to end_otherwise_0_3;\n position end_then_0_2;\n set r24 into authorized_balances[r5];\n position end_otherwise_0_3;\n\n\n\n\nfunction transfer_private:\n input r0 as address.private;\n input r1 as u128.private;\n input r2 as Token.record;\n sub r2.amount r1 into r3;\n cast r2.owner r3 r2.token_id r2.external_authorization_required r2.authorized_until into r4 as Token.record;\n ternary r2.external_authorization_required 0u32 4294967295u32 into r5;\n cast r0 r1 r2.token_id r2.external_authorization_required r5 into r6 as Token.record;\n async transfer_private r2.external_authorization_required r2.authorized_until into r7;\n output r4 as Token.record;\n output r6 as Token.record;\n output r7 as token_registry.aleo/transfer_private.future;\n\nfinalize transfer_private:\n input r0 as boolean.public;\n input r1 as u32.public;\n lte block.height r1 into r2;\n not r0 into r3;\n or r2 r3 into r4;\n assert.eq r4 true;\n\n\n\n\nfunction transfer_private_to_public:\n input r0 as address.public;\n input r1 as u128.public;\n input r2 as Token.record;\n sub r2.amount r1 into r3;\n cast r2.owner r3 r2.token_id r2.external_authorization_required r2.authorized_until into r4 as Token.record;\n cast r0 r2.token_id into r5 as TokenOwner;\n hash.bhp256 r5 into r6 as field;\n async transfer_private_to_public r2.token_id r0 r1 r2.authorized_until r2.external_authorization_required r6 into r7;\n output r4 as Token.record;\n output r7 as token_registry.aleo/transfer_private_to_public.future;\n\nfinalize transfer_private_to_public:\n input r0 as field.public;\n input r1 as address.public;\n input r2 as u128.public;\n input r3 as u32.public;\n input r4 as boolean.public;\n input r5 as field.public;\n lte block.height r3 into r6;\n not r4 into r7;\n or r6 r7 into r8;\n assert.eq r8 true;\n get registered_tokens[r0] into r9;\n ternary r9.external_authorization_required 0u32 4294967295u32 into r10;\n cast r0 r1 0u128 r10 into r11 as Balance;\n get.or_use balances[r5] r11 into r12;\n get.or_use authorized_balances[r5] r11 into r13;\n ternary r9.external_authorization_required r12.token_id r13.token_id into r14;\n ternary r9.external_authorization_required r12.account r13.account into r15;\n ternary r9.external_authorization_required r12.balance r13.balance into r16;\n ternary r9.external_authorization_required r12.authorized_until r13.authorized_until into r17;\n cast r14 r15 r16 r17 into r18 as Balance;\n add r18.balance r2 into r19;\n cast r0 r1 r19 r18.authorized_until into r20 as Balance;\n branch.eq r9.external_authorization_required false to end_then_0_4;\n set r20 into balances[r5];\n branch.eq true true to end_otherwise_0_5;\n position end_then_0_4;\n set r20 into authorized_balances[r5];\n position end_otherwise_0_5;\n\n\n\n\nfunction transfer_public_to_private:\n input r0 as field.public;\n input r1 as address.private;\n input r2 as u128.public;\n input r3 as boolean.public;\n ternary r3 0u32 4294967295u32 into r4;\n cast r1 r2 r0 r3 r4 into r5 as Token.record;\n cast self.caller r0 into r6 as TokenOwner;\n hash.bhp256 r6 into r7 as field;\n async transfer_public_to_private r0 r2 self.caller r3 r7 into r8;\n output r5 as Token.record;\n output r8 as token_registry.aleo/transfer_public_to_private.future;\n\nfinalize transfer_public_to_private:\n input r0 as field.public;\n input r1 as u128.public;\n input r2 as address.public;\n input r3 as boolean.public;\n input r4 as field.public;\n get registered_tokens[r0] into r5;\n assert.eq r5.external_authorization_required r3;\n get authorized_balances[r4] into r6;\n get registered_tokens[r0] into r7;\n lte block.height r6.authorized_until into r8;\n not r7.external_authorization_required into r9;\n or r8 r9 into r10;\n assert.eq r10 true;\n sub r6.balance r1 into r11;\n cast r0 r2 r11 r6.authorized_until into r12 as Balance;\n set r12 into authorized_balances[r4];\n\n\n\nfunction join:\n input r0 as Token.record;\n input r1 as Token.record;\n is.eq r0.token_id r1.token_id into r2;\n assert.eq r2 true;\n add r0.amount r1.amount into r3;\n lt r0.authorized_until r1.authorized_until into r4;\n ternary r4 r0.authorized_until r1.authorized_until into r5;\n cast r0.owner r3 r0.token_id r0.external_authorization_required r5 into r6 as Token.record;\n output r6 as Token.record;\n\n\nfunction split:\n input r0 as Token.record;\n input r1 as u128.private;\n gte r0.amount r1 into r2;\n assert.eq r2 true;\n cast r0.owner r1 r0.token_id r0.external_authorization_required r0.authorized_until into r3 as Token.record;\n sub r0.amount r1 into r4;\n cast r0.owner r4 r0.token_id r0.external_authorization_required r0.authorized_until into r5 as Token.record;\n output r3 as Token.record;\n output r5 as Token.record;\n\n\n\nfunction initialize:\n async initialize into r0;\n output r0 as token_registry.aleo/initialize.future;\n\nfinalize initialize:\n contains registered_tokens[3443843282313283355522573239085696902919850365217539366784739393210722344986field] into r0;\n assert.eq r0 false;\n cast 3443843282313283355522573239085696902919850365217539366784739393210722344986field 1095517519u128 1095517519u128 6u8 0u128 10_000_000_000_000_000u128 wrapped_credits.aleo false token_registry.aleo into r1 as TokenMetadata;\n set r1 into registered_tokens[3443843282313283355522573239085696902919850365217539366784739393210722344986field];\n\n\n\n\nfunction register_token:\n input r0 as field.public;\n input r1 as u128.public;\n input r2 as u128.public;\n input r3 as u8.public;\n input r4 as u128.public;\n input r5 as boolean.public;\n input r6 as address.public;\n is.neq r0 3443843282313283355522573239085696902919850365217539366784739393210722344986field into r7;\n assert.eq r7 true;\n cast r0 r1 r2 r3 0u128 r4 self.caller r5 r6 into r8 as TokenMetadata;\n async register_token r8 into r9;\n output r9 as token_registry.aleo/register_token.future;\n\nfinalize register_token:\n input r0 as TokenMetadata.public;\n contains registered_tokens[r0.token_id] into r1;\n assert.eq r1 false;\n set r0 into registered_tokens[r0.token_id];\n\n\n\n\nfunction update_token_management:\n input r0 as field.public;\n input r1 as address.public;\n input r2 as address.public;\n is.neq r0 3443843282313283355522573239085696902919850365217539366784739393210722344986field into r3;\n assert.eq r3 true;\n async update_token_management r0 r1 r2 self.caller into r4;\n output r4 as token_registry.aleo/update_token_management.future;\n\nfinalize update_token_management:\n input r0 as field.public;\n input r1 as address.public;\n input r2 as address.public;\n input r3 as address.public;\n get registered_tokens[r0] into r4;\n assert.eq r3 r4.admin;\n cast r0 r4.name r4.symbol r4.decimals r4.supply r4.max_supply r1 r4.external_authorization_required r2 into r5 as TokenMetadata;\n set r5 into registered_tokens[r0];\n\n\n\n\nfunction set_role:\n input r0 as field.public;\n input r1 as address.public;\n input r2 as u8.public;\n is.neq r0 3443843282313283355522573239085696902919850365217539366784739393210722344986field into r3;\n assert.eq r3 true;\n is.eq r2 1u8 into r4;\n is.eq r2 2u8 into r5;\n or r4 r5 into r6;\n is.eq r2 3u8 into r7;\n or r6 r7 into r8;\n assert.eq r8 true;\n cast r1 r0 into r9 as TokenOwner;\n hash.bhp256 r9 into r10 as field;\n async set_role r0 r2 self.caller r10 into r11;\n output r11 as token_registry.aleo/set_role.future;\n\nfinalize set_role:\n input r0 as field.public;\n input r1 as u8.public;\n input r2 as address.public;\n input r3 as field.public;\n get registered_tokens[r0] into r4;\n assert.eq r2 r4.admin;\n set r1 into roles[r3];\n\n\n\n\nfunction remove_role:\n input r0 as field.public;\n input r1 as address.public;\n is.neq r0 3443843282313283355522573239085696902919850365217539366784739393210722344986field into r2;\n assert.eq r2 true;\n cast r1 r0 into r3 as TokenOwner;\n hash.bhp256 r3 into r4 as field;\n async remove_role r0 self.caller r4 into r5;\n output r5 as token_registry.aleo/remove_role.future;\n\nfinalize remove_role:\n input r0 as field.public;\n input r1 as address.public;\n input r2 as field.public;\n get registered_tokens[r0] into r3;\n assert.eq r1 r3.admin;\n remove roles[r2];\n\nfunction mint_public:\n input r0 as field.public;\n input r1 as address.public;\n input r2 as u128.public;\n input r3 as u32.public;\n cast self.caller r0 into r4 as TokenOwner;\n hash.bhp256 r4 into r5 as field;\n cast r1 r0 into r6 as TokenOwner;\n hash.bhp256 r6 into r7 as field;\n async mint_public r0 r1 r2 r3 self.caller r5 r7 into r8;\n output r8 as token_registry.aleo/mint_public.future;\n\nfinalize mint_public:\n input r0 as field.public;\n input r1 as address.public;\n input r2 as u128.public;\n input r3 as u32.public;\n input r4 as address.public;\n input r5 as field.public;\n input r6 as field.public;\n get registered_tokens[r0] into r7;\n is.eq r4 r7.admin into r8;\n not r8 into r9;\n branch.eq r9 false to end_then_0_6;\n get roles[r5] into r10;\n is.eq r10 1u8 into r11;\n is.eq r10 3u8 into r12;\n or r11 r12 into r13;\n assert.eq r13 true;\n branch.eq true true to end_otherwise_0_7;\n position end_then_0_6;\n position end_otherwise_0_7;\n add r7.supply r2 into r14;\n lte r14 r7.max_supply into r15;\n assert.eq r15 true;\n cast r0 r1 0u128 r3 into r16 as Balance;\n get.or_use balances[r6] r16 into r17;\n get.or_use authorized_balances[r6] r16 into r18;\n ternary r7.external_authorization_required r17.token_id r18.token_id into r19;\n ternary r7.external_authorization_required r17.account r18.account into r20;\n ternary r7.external_authorization_required r17.balance r18.balance into r21;\n ternary r7.external_authorization_required r17.authorized_until r18.authorized_until into r22;\n cast r19 r20 r21 r22 into r23 as Balance;\n add r23.balance r2 into r24;\n cast r0 r1 r24 r23.authorized_until into r25 as Balance;\n branch.eq r7.external_authorization_required false to end_then_0_8;\n set r25 into balances[r6];\n branch.eq true true to end_otherwise_0_9;\n position end_then_0_8;\n set r25 into authorized_balances[r6];\n position end_otherwise_0_9;\n cast r0 r7.name r7.symbol r7.decimals r14 r7.max_supply r7.admin r7.external_authorization_required r7.external_authorization_party into r26 as TokenMetadata;\n set r26 into registered_tokens[r0];\n\n\n\n\nfunction mint_private:\n input r0 as field.public;\n input r1 as address.private;\n input r2 as u128.public;\n input r3 as boolean.public;\n input r4 as u32.public;\n cast r1 r2 r0 r3 r4 into r5 as Token.record;\n cast self.caller r0 into r6 as TokenOwner;\n hash.bhp256 r6 into r7 as field;\n async mint_private r0 r2 r3 r4 self.caller r7 into r8;\n output r5 as Token.record;\n output r8 as token_registry.aleo/mint_private.future;\n\nfinalize mint_private:\n input r0 as field.public;\n input r1 as u128.public;\n input r2 as boolean.public;\n input r3 as u32.public;\n input r4 as address.public;\n input r5 as field.public;\n get registered_tokens[r0] into r6;\n is.eq r4 r6.admin into r7;\n not r7 into r8;\n branch.eq r8 false to end_then_0_10;\n get roles[r5] into r9;\n is.eq r9 1u8 into r10;\n is.eq r9 3u8 into r11;\n or r10 r11 into r12;\n assert.eq r12 true;\n branch.eq true true to end_otherwise_0_11;\n position end_then_0_10;\n position end_otherwise_0_11;\n add r6.supply r1 into r13;\n lte r13 r6.max_supply into r14;\n assert.eq r14 true;\n assert.eq r6.external_authorization_required r2;\n is.eq r3 0u32 into r15;\n not r6.external_authorization_required into r16;\n or r15 r16 into r17;\n assert.eq r17 true;\n cast r0 r6.name r6.symbol r6.decimals r13 r6.max_supply r6.admin r6.external_authorization_required r6.external_authorization_party into r18 as TokenMetadata;\n set r18 into registered_tokens[r0];\n\n\n\n\nfunction burn_public:\n input r0 as field.public;\n input r1 as address.public;\n input r2 as u128.public;\n cast r1 r0 into r3 as TokenOwner;\n hash.bhp256 r3 into r4 as field;\n cast self.caller r0 into r5 as TokenOwner;\n hash.bhp256 r5 into r6 as field;\n async burn_public r3 r2 self.caller r6 r4 into r7;\n output r7 as token_registry.aleo/burn_public.future;\n\nfinalize burn_public:\n input r0 as TokenOwner.public;\n input r1 as u128.public;\n input r2 as address.public;\n input r3 as field.public;\n input r4 as field.public;\n get registered_tokens[r0.token_id] into r5;\n is.neq r2 r5.admin into r6;\n branch.eq r6 false to end_then_0_12;\n get roles[r3] into r7;\n is.eq r7 2u8 into r8;\n is.eq r7 3u8 into r9;\n or r8 r9 into r10;\n assert.eq r10 true;\n branch.eq true true to end_otherwise_0_13;\n position end_then_0_12;\n position end_otherwise_0_13;\n sub r5.supply r1 into r11;\n cast r5.token_id r5.name r5.symbol r5.decimals r11 r5.max_supply r5.admin r5.external_authorization_required r5.external_authorization_party into r12 as TokenMetadata;\n set r12 into registered_tokens[r0.token_id];\n cast r0.token_id r0.account 0u128 0u32 into r13 as Balance;\n get.or_use authorized_balances[r4] r13 into r14;\n gte r14.balance 0u128 into r15;\n branch.eq r15 false to end_then_0_14;\n gt r14.balance r1 into r16;\n branch.eq r16 false to end_then_1_16;\n sub r14.balance r1 into r17;\n cast r0.token_id r0.account r17 r14.authorized_until into r18 as Balance;\n set r18 into authorized_balances[r4];\n branch.eq true true to end_otherwise_1_17;\n position end_then_1_16;\n cast r0.token_id r0.account 0u128 r14.authorized_until into r19 as Balance;\n set r19 into authorized_balances[r4];\n sub r1 r14.balance into r20;\n is.eq r20 0u128 into r21;\n branch.eq r21 false to end_then_2_18;\n branch.eq true true to end_otherwise_2_19;\n position end_then_2_18;\n get balances[r4] into r22;\n sub r22.balance r20 into r23;\n cast r0.token_id r0.account r23 r22.authorized_until into r24 as Balance;\n set r24 into balances[r4];\n position end_otherwise_2_19;\n position end_otherwise_1_17;\n branch.eq true true to end_otherwise_0_15;\n position end_then_0_14;\n get balances[r4] into r25;\n sub r25.balance r1 into r26;\n cast r0.token_id r0.account r26 r25.authorized_until into r27 as Balance;\n set r27 into balances[r4];\n position end_otherwise_0_15;\n\n\n\n\nfunction burn_private:\n input r0 as Token.record;\n input r1 as u128.public;\n sub r0.amount r1 into r2;\n cast r0.owner r2 r0.token_id r0.external_authorization_required r0.authorized_until into r3 as Token.record;\n cast self.caller r0.token_id into r4 as TokenOwner;\n hash.bhp256 r4 into r5 as field;\n async burn_private r0.token_id r1 self.caller r5 into r6;\n output r3 as Token.record;\n output r6 as token_registry.aleo/burn_private.future;\n\nfinalize burn_private:\n input r0 as field.public;\n input r1 as u128.public;\n input r2 as address.public;\n input r3 as field.public;\n get registered_tokens[r0] into r4;\n is.eq r2 r4.admin into r5;\n not r5 into r6;\n branch.eq r6 false to end_then_0_20;\n get roles[r3] into r7;\n is.eq r7 2u8 into r8;\n is.eq r7 3u8 into r9;\n or r8 r9 into r10;\n assert.eq r10 true;\n branch.eq true true to end_otherwise_0_21;\n position end_then_0_20;\n position end_otherwise_0_21;\n sub r4.supply r1 into r11;\n cast r0 r4.name r4.symbol r4.decimals r11 r4.max_supply r4.admin r4.external_authorization_required r4.external_authorization_party into r12 as TokenMetadata;\n set r12 into registered_tokens[r0];\n\n\n\n\nfunction prehook_public:\n input r0 as TokenOwner.public;\n input r1 as u128.public;\n input r2 as u32.public;\n hash.bhp256 r0 into r3 as field;\n async prehook_public r0 r1 r2 self.caller r3 into r4;\n output r4 as token_registry.aleo/prehook_public.future;\n\nfinalize prehook_public:\n input r0 as TokenOwner.public;\n input r1 as u128.public;\n input r2 as u32.public;\n input r3 as address.public;\n input r4 as field.public;\n get registered_tokens[r0.token_id] into r5;\n assert.eq r5.external_authorization_required true;\n is.eq r3 r5.external_authorization_party into r6;\n assert.eq r6 true;\n cast r0.token_id r0.account 0u128 0u32 into r7 as Balance;\n get.or_use balances[r4] r7 into r8;\n get.or_use authorized_balances[r4] r7 into r9;\n lt r9.authorized_until block.height into r10;\n add r8.balance r9.balance into r11;\n ternary r10 r11 r8.balance into r12;\n ternary r10 0u128 r9.balance into r13;\n sub r12 r1 into r14;\n add r13 r1 into r15;\n cast r0.token_id r0.account r15 r2 into r16 as Balance;\n set r16 into authorized_balances[r4];\n cast r0.token_id r0.account r14 r8.authorized_until into r17 as Balance;\n set r17 into balances[r4];\n\n\n\n\nfunction prehook_private:\n input r0 as Token.record;\n input r1 as u128.private;\n input r2 as u32.private;\n sub r0.amount r1 into r3;\n cast r0.owner r3 r0.token_id r0.external_authorization_required r0.authorized_until into r4 as Token.record;\n cast r0.owner r1 r0.token_id r0.external_authorization_required r2 into r5 as Token.record;\n async prehook_private r0.token_id self.caller into r6;\n output r4 as Token.record;\n output r5 as Token.record;\n output r6 as token_registry.aleo/prehook_private.future;\n\nfinalize prehook_private:\n input r0 as field.public;\n input r1 as address.public;\n get registered_tokens[r0] into r2;\n is.eq r1 r2.external_authorization_party into r3;\n assert.eq r3 true;\n\n\n\n\nfunction approve_public:\n input r0 as field.public;\n input r1 as address.public;\n input r2 as u128.public;\n cast self.caller r1 r0 into r3 as Allowance;\n hash.bhp256 r3 into r4 as field;\n async approve_public r2 r4 into r5;\n output r5 as token_registry.aleo/approve_public.future;\n\nfinalize approve_public:\n input r0 as u128.public;\n input r1 as field.public;\n get.or_use allowances[r1] 0u128 into r2;\n add r2 r0 into r3;\n set r3 into allowances[r1];\n\n\n\n\nfunction unapprove_public:\n input r0 as field.public;\n input r1 as address.public;\n input r2 as u128.public;\n cast self.caller r1 r0 into r3 as Allowance;\n hash.bhp256 r3 into r4 as field;\n async unapprove_public r2 r4 into r5;\n output r5 as token_registry.aleo/unapprove_public.future;\n\nfinalize unapprove_public:\n input r0 as u128.public;\n input r1 as field.public;\n get allowances[r1] into r2;\n sub r2 r0 into r3;\n set r3 into allowances[r1];\n\n\n\n\nfunction transfer_from_public:\n input r0 as field.public;\n input r1 as address.public;\n input r2 as address.public;\n input r3 as u128.public;\n cast r1 self.caller r0 into r4 as Allowance;\n hash.bhp256 r4 into r5 as field;\n cast r1 r0 into r6 as TokenOwner;\n hash.bhp256 r6 into r7 as field;\n cast r2 r0 into r8 as TokenOwner;\n hash.bhp256 r8 into r9 as field;\n async transfer_from_public r0 r1 r2 r3 r5 r7 r9 into r10;\n output r10 as token_registry.aleo/transfer_from_public.future;\n\nfinalize transfer_from_public:\n input r0 as field.public;\n input r1 as address.public;\n input r2 as address.public;\n input r3 as u128.public;\n input r4 as field.public;\n input r5 as field.public;\n input r6 as field.public;\n get allowances[r4] into r7;\n sub r7 r3 into r8;\n set r8 into allowances[r4];\n get authorized_balances[r5] into r9;\n get registered_tokens[r0] into r10;\n lte block.height r9.authorized_until into r11;\n not r10.external_authorization_required into r12;\n or r11 r12 into r13;\n assert.eq r13 true;\n sub r9.balance r3 into r14;\n cast r0 r1 r14 r9.authorized_until into r15 as Balance;\n set r15 into authorized_balances[r5];\n get registered_tokens[r0] into r16;\n ternary r16.external_authorization_required 0u32 4294967295u32 into r17;\n cast r0 r2 0u128 r17 into r18 as Balance;\n get.or_use balances[r6] r18 into r19;\n get.or_use authorized_balances[r6] r18 into r20;\n ternary r16.external_authorization_required r19.token_id r20.token_id into r21;\n ternary r16.external_authorization_required r19.account r20.account into r22;\n ternary r16.external_authorization_required r19.balance r20.balance into r23;\n ternary r16.external_authorization_required r19.authorized_until r20.authorized_until into r24;\n cast r21 r22 r23 r24 into r25 as Balance;\n add r25.balance r3 into r26;\n cast r0 r2 r26 r25.authorized_until into r27 as Balance;\n branch.eq r16.external_authorization_required false to end_then_0_22;\n set r27 into balances[r6];\n branch.eq true true to end_otherwise_0_23;\n position end_then_0_22;\n set r27 into authorized_balances[r6];\n position end_otherwise_0_23;\n\n\n\n\nfunction transfer_from_public_to_private:\n input r0 as field.public;\n input r1 as address.public;\n input r2 as address.private;\n input r3 as u128.public;\n input r4 as boolean.public;\n ternary r4 0u32 4294967295u32 into r5;\n cast r2 r3 r0 r4 r5 into r6 as Token.record;\n cast r1 self.caller r0 into r7 as Allowance;\n hash.bhp256 r7 into r8 as field;\n cast r1 r0 into r9 as TokenOwner;\n hash.bhp256 r9 into r10 as field;\n async transfer_from_public_to_private r0 r1 r3 r4 r8 r10 into r11;\n output r6 as Token.record;\n output r11 as token_registry.aleo/transfer_from_public_to_private.future;\n\nfinalize transfer_from_public_to_private:\n input r0 as field.public;\n input r1 as address.public;\n input r2 as u128.public;\n input r3 as boolean.public;\n input r4 as field.public;\n input r5 as field.public;\n get registered_tokens[r0] into r6;\n assert.eq r6.external_authorization_required r3;\n get allowances[r4] into r7;\n sub r7 r2 into r8;\n set r8 into allowances[r4];\n get authorized_balances[r5] into r9;\n get registered_tokens[r0] into r10;\n lte block.height r9.authorized_until into r11;\n not r10.external_authorization_required into r12;\n or r11 r12 into r13;\n assert.eq r13 true;\n sub r9.balance r2 into r14;\n cast r0 r1 r14 r9.authorized_until into r15 as Balance;\n set r15 into authorized_balances[r5];\n\nconstructor:\n assert.eq true true;`;
21
+ const validator_announce = `program validator_announce.aleo;\n\nstruct EthAddress:\n bytes as [u8; 20u32];\n\nstruct StorageLocationKey:\n validator as [u8; 20u32];\n index as u8;\n\nstruct ValidatorAnnounce:\n mailbox as [u8; 32u32];\n local_domain as u32;\n\nstruct HashKey:\n hash as [u8; 32u32];\n\nmapping storage_sequences:\n key as EthAddress.public;\n value as u8.public;\n\nmapping storage_locations:\n key as StorageLocationKey.public;\n value as [u8; 480u32].public;\n\nmapping replay_protection:\n key as HashKey.public;\n value as boolean.public;\n\nmapping validator_announce:\n key as boolean.public;\n value as ValidatorAnnounce.public;\n\nfunction init:\n input r0 as address.private;\n input r1 as u32.private;\n serialize.bits.raw r0 (address) into r2 ([boolean; 253u32]);\n cast false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false into r3 as [boolean; 256u32];\n cast r2[0u32] r2[1u32] r2[2u32] r2[3u32] r2[4u32] r2[5u32] r2[6u32] r2[7u32] r2[8u32] r2[9u32] r2[10u32] r2[11u32] r2[12u32] r2[13u32] r2[14u32] r2[15u32] r2[16u32] r2[17u32] r2[18u32] r2[19u32] r2[20u32] r2[21u32] r2[22u32] r2[23u32] r2[24u32] r2[25u32] r2[26u32] r2[27u32] r2[28u32] r2[29u32] r2[30u32] r2[31u32] r2[32u32] r2[33u32] r2[34u32] r2[35u32] r2[36u32] r2[37u32] r2[38u32] r2[39u32] r2[40u32] r2[41u32] r2[42u32] r2[43u32] r2[44u32] r2[45u32] r2[46u32] r2[47u32] r2[48u32] r2[49u32] r2[50u32] r2[51u32] r2[52u32] r2[53u32] r2[54u32] r2[55u32] r2[56u32] r2[57u32] r2[58u32] r2[59u32] r2[60u32] r2[61u32] r2[62u32] r2[63u32] r2[64u32] r2[65u32] r2[66u32] r2[67u32] r2[68u32] r2[69u32] r2[70u32] r2[71u32] r2[72u32] r2[73u32] r2[74u32] r2[75u32] r2[76u32] r2[77u32] r2[78u32] r2[79u32] r2[80u32] r2[81u32] r2[82u32] r2[83u32] r2[84u32] r2[85u32] r2[86u32] r2[87u32] r2[88u32] r2[89u32] r2[90u32] r2[91u32] r2[92u32] r2[93u32] r2[94u32] r2[95u32] r2[96u32] r2[97u32] r2[98u32] r2[99u32] r2[100u32] r2[101u32] r2[102u32] r2[103u32] r2[104u32] r2[105u32] r2[106u32] r2[107u32] r2[108u32] r2[109u32] r2[110u32] r2[111u32] r2[112u32] r2[113u32] r2[114u32] r2[115u32] r2[116u32] r2[117u32] r2[118u32] r2[119u32] r2[120u32] r2[121u32] r2[122u32] r2[123u32] r2[124u32] r2[125u32] r2[126u32] r2[127u32] r2[128u32] r2[129u32] r2[130u32] r2[131u32] r2[132u32] r2[133u32] r2[134u32] r2[135u32] r2[136u32] r2[137u32] r2[138u32] r2[139u32] r2[140u32] r2[141u32] r2[142u32] r2[143u32] r2[144u32] r2[145u32] r2[146u32] r2[147u32] r2[148u32] r2[149u32] r2[150u32] r2[151u32] r2[152u32] r2[153u32] r2[154u32] r2[155u32] r2[156u32] r2[157u32] r2[158u32] r2[159u32] r2[160u32] r2[161u32] r2[162u32] r2[163u32] r2[164u32] r2[165u32] r2[166u32] r2[167u32] r2[168u32] r2[169u32] r2[170u32] r2[171u32] r2[172u32] r2[173u32] r2[174u32] r2[175u32] r2[176u32] r2[177u32] r2[178u32] r2[179u32] r2[180u32] r2[181u32] r2[182u32] r2[183u32] r2[184u32] r2[185u32] r2[186u32] r2[187u32] r2[188u32] r2[189u32] r2[190u32] r2[191u32] r2[192u32] r2[193u32] r2[194u32] r2[195u32] r2[196u32] r2[197u32] r2[198u32] r2[199u32] r2[200u32] r2[201u32] r2[202u32] r2[203u32] r2[204u32] r2[205u32] r2[206u32] r2[207u32] r2[208u32] r2[209u32] r2[210u32] r2[211u32] r2[212u32] r2[213u32] r2[214u32] r2[215u32] r2[216u32] r2[217u32] r2[218u32] r2[219u32] r2[220u32] r2[221u32] r2[222u32] r2[223u32] r2[224u32] r2[225u32] r2[226u32] r2[227u32] r2[228u32] r2[229u32] r2[230u32] r2[231u32] r2[232u32] r2[233u32] r2[234u32] r2[235u32] r2[236u32] r2[237u32] r2[238u32] r2[239u32] r2[240u32] r2[241u32] r2[242u32] r2[243u32] r2[244u32] r2[245u32] r2[246u32] r2[247u32] r2[248u32] r2[249u32] r2[250u32] r2[251u32] r2[252u32] r3[253u32] r3[254u32] r3[255u32] into r4 as [boolean; 256u32];\n deserialize.bits.raw r4 ([boolean; 256u32]) into r5 ([u8; 32u32]);\n async init r5 r1 into r6;\n output r6 as validator_announce.aleo/init.future;\n\nfinalize init:\n input r0 as [u8; 32u32].public;\n input r1 as u32.public;\n contains validator_announce[true] into r2;\n not r2 into r3;\n assert.eq r3 true;\n cast r0 r1 into r4 as ValidatorAnnounce;\n set r4 into validator_announce[true];\n\nfunction get_address:\n output validator_announce.aleo as address.private;\n\nfunction announce:\n input r0 as [u8; 20u32].private;\n input r1 as [u8; 480u32].private;\n input r2 as [u8; 65u32].private;\n async announce r0 r1 r2 into r3;\n output r3 as validator_announce.aleo/announce.future;\n\nfinalize announce:\n input r0 as [u8; 20u32].public;\n input r1 as [u8; 480u32].public;\n input r2 as [u8; 65u32].public;\n contains validator_announce[true] into r3;\n assert.eq r3 true;\n get validator_announce[true] into r4;\n cast r0[0u32] r0[1u32] r0[2u32] r0[3u32] r0[4u32] r0[5u32] r0[6u32] r0[7u32] r0[8u32] r0[9u32] r0[10u32] r0[11u32] r0[12u32] r0[13u32] r0[14u32] r0[15u32] r0[16u32] r0[17u32] r0[18u32] r0[19u32] r1[0u32] r1[1u32] r1[2u32] r1[3u32] r1[4u32] r1[5u32] r1[6u32] r1[7u32] r1[8u32] r1[9u32] r1[10u32] r1[11u32] r1[12u32] r1[13u32] r1[14u32] r1[15u32] r1[16u32] r1[17u32] r1[18u32] r1[19u32] r1[20u32] r1[21u32] r1[22u32] r1[23u32] r1[24u32] r1[25u32] r1[26u32] r1[27u32] r1[28u32] r1[29u32] r1[30u32] r1[31u32] r1[32u32] r1[33u32] r1[34u32] r1[35u32] r1[36u32] r1[37u32] r1[38u32] r1[39u32] r1[40u32] r1[41u32] r1[42u32] r1[43u32] r1[44u32] r1[45u32] r1[46u32] r1[47u32] r1[48u32] r1[49u32] r1[50u32] r1[51u32] r1[52u32] r1[53u32] r1[54u32] r1[55u32] r1[56u32] r1[57u32] r1[58u32] r1[59u32] r1[60u32] r1[61u32] r1[62u32] r1[63u32] r1[64u32] r1[65u32] r1[66u32] r1[67u32] r1[68u32] r1[69u32] r1[70u32] r1[71u32] r1[72u32] r1[73u32] r1[74u32] r1[75u32] r1[76u32] r1[77u32] r1[78u32] r1[79u32] r1[80u32] r1[81u32] r1[82u32] r1[83u32] r1[84u32] r1[85u32] r1[86u32] r1[87u32] r1[88u32] r1[89u32] r1[90u32] r1[91u32] r1[92u32] r1[93u32] r1[94u32] r1[95u32] r1[96u32] r1[97u32] r1[98u32] r1[99u32] r1[100u32] r1[101u32] r1[102u32] r1[103u32] r1[104u32] r1[105u32] r1[106u32] r1[107u32] r1[108u32] r1[109u32] r1[110u32] r1[111u32] r1[112u32] r1[113u32] r1[114u32] r1[115u32] r1[116u32] r1[117u32] r1[118u32] r1[119u32] r1[120u32] r1[121u32] r1[122u32] r1[123u32] r1[124u32] r1[125u32] r1[126u32] r1[127u32] r1[128u32] r1[129u32] r1[130u32] r1[131u32] r1[132u32] r1[133u32] r1[134u32] r1[135u32] r1[136u32] r1[137u32] r1[138u32] r1[139u32] r1[140u32] r1[141u32] r1[142u32] r1[143u32] r1[144u32] r1[145u32] r1[146u32] r1[147u32] r1[148u32] r1[149u32] r1[150u32] r1[151u32] r1[152u32] r1[153u32] r1[154u32] r1[155u32] r1[156u32] r1[157u32] r1[158u32] r1[159u32] r1[160u32] r1[161u32] r1[162u32] r1[163u32] r1[164u32] r1[165u32] r1[166u32] r1[167u32] r1[168u32] r1[169u32] r1[170u32] r1[171u32] r1[172u32] r1[173u32] r1[174u32] r1[175u32] r1[176u32] r1[177u32] r1[178u32] r1[179u32] r1[180u32] r1[181u32] r1[182u32] r1[183u32] r1[184u32] r1[185u32] r1[186u32] r1[187u32] r1[188u32] r1[189u32] r1[190u32] r1[191u32] r1[192u32] r1[193u32] r1[194u32] r1[195u32] r1[196u32] r1[197u32] r1[198u32] r1[199u32] r1[200u32] r1[201u32] r1[202u32] r1[203u32] r1[204u32] r1[205u32] r1[206u32] r1[207u32] r1[208u32] r1[209u32] r1[210u32] r1[211u32] r1[212u32] r1[213u32] r1[214u32] r1[215u32] r1[216u32] r1[217u32] r1[218u32] r1[219u32] r1[220u32] r1[221u32] r1[222u32] r1[223u32] r1[224u32] r1[225u32] r1[226u32] r1[227u32] r1[228u32] r1[229u32] r1[230u32] r1[231u32] r1[232u32] r1[233u32] r1[234u32] r1[235u32] r1[236u32] r1[237u32] r1[238u32] r1[239u32] r1[240u32] r1[241u32] r1[242u32] r1[243u32] r1[244u32] r1[245u32] r1[246u32] r1[247u32] r1[248u32] r1[249u32] r1[250u32] r1[251u32] r1[252u32] r1[253u32] r1[254u32] r1[255u32] r1[256u32] r1[257u32] r1[258u32] r1[259u32] r1[260u32] r1[261u32] r1[262u32] r1[263u32] r1[264u32] r1[265u32] r1[266u32] r1[267u32] r1[268u32] r1[269u32] r1[270u32] r1[271u32] r1[272u32] r1[273u32] r1[274u32] r1[275u32] r1[276u32] r1[277u32] r1[278u32] r1[279u32] r1[280u32] r1[281u32] r1[282u32] r1[283u32] r1[284u32] r1[285u32] r1[286u32] r1[287u32] r1[288u32] r1[289u32] r1[290u32] r1[291u32] r1[292u32] r1[293u32] r1[294u32] r1[295u32] r1[296u32] r1[297u32] r1[298u32] r1[299u32] r1[300u32] r1[301u32] r1[302u32] r1[303u32] r1[304u32] r1[305u32] r1[306u32] r1[307u32] r1[308u32] r1[309u32] r1[310u32] r1[311u32] r1[312u32] r1[313u32] r1[314u32] r1[315u32] r1[316u32] r1[317u32] r1[318u32] r1[319u32] r1[320u32] r1[321u32] r1[322u32] r1[323u32] r1[324u32] r1[325u32] r1[326u32] r1[327u32] r1[328u32] r1[329u32] r1[330u32] r1[331u32] r1[332u32] r1[333u32] r1[334u32] r1[335u32] r1[336u32] r1[337u32] r1[338u32] r1[339u32] r1[340u32] r1[341u32] r1[342u32] r1[343u32] r1[344u32] r1[345u32] r1[346u32] r1[347u32] r1[348u32] r1[349u32] r1[350u32] r1[351u32] r1[352u32] r1[353u32] r1[354u32] r1[355u32] r1[356u32] r1[357u32] r1[358u32] r1[359u32] r1[360u32] r1[361u32] r1[362u32] r1[363u32] r1[364u32] r1[365u32] r1[366u32] r1[367u32] r1[368u32] r1[369u32] r1[370u32] r1[371u32] r1[372u32] r1[373u32] r1[374u32] r1[375u32] r1[376u32] r1[377u32] r1[378u32] r1[379u32] r1[380u32] r1[381u32] r1[382u32] r1[383u32] r1[384u32] r1[385u32] r1[386u32] r1[387u32] r1[388u32] r1[389u32] r1[390u32] r1[391u32] r1[392u32] r1[393u32] r1[394u32] r1[395u32] r1[396u32] r1[397u32] r1[398u32] r1[399u32] r1[400u32] r1[401u32] r1[402u32] r1[403u32] r1[404u32] r1[405u32] r1[406u32] r1[407u32] r1[408u32] r1[409u32] r1[410u32] r1[411u32] r1[412u32] r1[413u32] r1[414u32] r1[415u32] r1[416u32] r1[417u32] r1[418u32] r1[419u32] r1[420u32] r1[421u32] r1[422u32] r1[423u32] r1[424u32] r1[425u32] r1[426u32] r1[427u32] r1[428u32] r1[429u32] r1[430u32] r1[431u32] r1[432u32] r1[433u32] r1[434u32] r1[435u32] r1[436u32] r1[437u32] r1[438u32] r1[439u32] r1[440u32] r1[441u32] r1[442u32] r1[443u32] r1[444u32] r1[445u32] r1[446u32] r1[447u32] r1[448u32] r1[449u32] r1[450u32] r1[451u32] r1[452u32] r1[453u32] r1[454u32] r1[455u32] r1[456u32] r1[457u32] r1[458u32] r1[459u32] r1[460u32] r1[461u32] r1[462u32] r1[463u32] r1[464u32] r1[465u32] r1[466u32] r1[467u32] r1[468u32] r1[469u32] r1[470u32] r1[471u32] r1[472u32] r1[473u32] r1[474u32] r1[475u32] r1[476u32] r1[477u32] r1[478u32] r1[479u32] into r5 as [u8; 500u32];\n hash.keccak256.native.raw r5 into r6 as [boolean; 256u32];\n deserialize.bits.raw r6 ([boolean; 256u32]) into r7 ([u8; 32u32]);\n cast r7 into r8 as HashKey;\n contains replay_protection[r8] into r9;\n not r9 into r10;\n assert.eq r10 true;\n cast r0 into r11 as EthAddress;\n get.or_use storage_sequences[r11] 0u8 into r12;\n shr r4.local_domain 24u32 into r13;\n cast r13 into r14 as u8;\n shr r4.local_domain 16u32 into r15;\n rem r15 256u32 into r16;\n cast r16 into r17 as u8;\n shr r4.local_domain 8u32 into r18;\n rem r18 256u32 into r19;\n cast r19 into r20 as u8;\n rem r4.local_domain 256u32 into r21;\n cast r21 into r22 as u8;\n cast r14 r17 r20 r22 r4.mailbox[0u32] r4.mailbox[1u32] r4.mailbox[2u32] r4.mailbox[3u32] r4.mailbox[4u32] r4.mailbox[5u32] r4.mailbox[6u32] r4.mailbox[7u32] r4.mailbox[8u32] r4.mailbox[9u32] r4.mailbox[10u32] r4.mailbox[11u32] r4.mailbox[12u32] r4.mailbox[13u32] r4.mailbox[14u32] r4.mailbox[15u32] r4.mailbox[16u32] r4.mailbox[17u32] r4.mailbox[18u32] r4.mailbox[19u32] r4.mailbox[20u32] r4.mailbox[21u32] r4.mailbox[22u32] r4.mailbox[23u32] r4.mailbox[24u32] r4.mailbox[25u32] r4.mailbox[26u32] r4.mailbox[27u32] r4.mailbox[28u32] r4.mailbox[29u32] r4.mailbox[30u32] r4.mailbox[31u32] 72u8 89u8 80u8 69u8 82u8 76u8 65u8 78u8 69u8 95u8 65u8 78u8 78u8 79u8 85u8 78u8 67u8 69u8 77u8 69u8 78u8 84u8 into r23 as [u8; 58u32];\n hash.keccak256.native.raw r23 into r24 as [boolean; 256u32];\n deserialize.bits.raw r24 ([boolean; 256u32]) into r25 ([u8; 32u32]);\n cast r25[0u32] r25[1u32] r25[2u32] r25[3u32] r25[4u32] r25[5u32] r25[6u32] r25[7u32] r25[8u32] r25[9u32] r25[10u32] r25[11u32] r25[12u32] r25[13u32] r25[14u32] r25[15u32] r25[16u32] r25[17u32] r25[18u32] r25[19u32] r25[20u32] r25[21u32] r25[22u32] r25[23u32] r25[24u32] r25[25u32] r25[26u32] r25[27u32] r25[28u32] r25[29u32] r25[30u32] r25[31u32] r1[0u32] r1[1u32] r1[2u32] r1[3u32] r1[4u32] r1[5u32] r1[6u32] r1[7u32] r1[8u32] r1[9u32] r1[10u32] r1[11u32] r1[12u32] r1[13u32] r1[14u32] r1[15u32] r1[16u32] r1[17u32] r1[18u32] r1[19u32] r1[20u32] r1[21u32] r1[22u32] r1[23u32] r1[24u32] r1[25u32] r1[26u32] r1[27u32] r1[28u32] r1[29u32] r1[30u32] r1[31u32] r1[32u32] r1[33u32] r1[34u32] r1[35u32] r1[36u32] r1[37u32] r1[38u32] r1[39u32] r1[40u32] r1[41u32] r1[42u32] r1[43u32] r1[44u32] r1[45u32] r1[46u32] r1[47u32] r1[48u32] r1[49u32] r1[50u32] r1[51u32] r1[52u32] r1[53u32] r1[54u32] r1[55u32] r1[56u32] r1[57u32] r1[58u32] r1[59u32] r1[60u32] r1[61u32] r1[62u32] r1[63u32] r1[64u32] r1[65u32] r1[66u32] r1[67u32] r1[68u32] r1[69u32] r1[70u32] r1[71u32] r1[72u32] r1[73u32] r1[74u32] r1[75u32] r1[76u32] r1[77u32] r1[78u32] r1[79u32] r1[80u32] r1[81u32] r1[82u32] r1[83u32] r1[84u32] r1[85u32] r1[86u32] r1[87u32] r1[88u32] r1[89u32] r1[90u32] r1[91u32] r1[92u32] r1[93u32] r1[94u32] r1[95u32] r1[96u32] r1[97u32] r1[98u32] r1[99u32] r1[100u32] r1[101u32] r1[102u32] r1[103u32] r1[104u32] r1[105u32] r1[106u32] r1[107u32] r1[108u32] r1[109u32] r1[110u32] r1[111u32] r1[112u32] r1[113u32] r1[114u32] r1[115u32] r1[116u32] r1[117u32] r1[118u32] r1[119u32] r1[120u32] r1[121u32] r1[122u32] r1[123u32] r1[124u32] r1[125u32] r1[126u32] r1[127u32] r1[128u32] r1[129u32] r1[130u32] r1[131u32] r1[132u32] r1[133u32] r1[134u32] r1[135u32] r1[136u32] r1[137u32] r1[138u32] r1[139u32] r1[140u32] r1[141u32] r1[142u32] r1[143u32] r1[144u32] r1[145u32] r1[146u32] r1[147u32] r1[148u32] r1[149u32] r1[150u32] r1[151u32] r1[152u32] r1[153u32] r1[154u32] r1[155u32] r1[156u32] r1[157u32] r1[158u32] r1[159u32] r1[160u32] r1[161u32] r1[162u32] r1[163u32] r1[164u32] r1[165u32] r1[166u32] r1[167u32] r1[168u32] r1[169u32] r1[170u32] r1[171u32] r1[172u32] r1[173u32] r1[174u32] r1[175u32] r1[176u32] r1[177u32] r1[178u32] r1[179u32] r1[180u32] r1[181u32] r1[182u32] r1[183u32] r1[184u32] r1[185u32] r1[186u32] r1[187u32] r1[188u32] r1[189u32] r1[190u32] r1[191u32] r1[192u32] r1[193u32] r1[194u32] r1[195u32] r1[196u32] r1[197u32] r1[198u32] r1[199u32] r1[200u32] r1[201u32] r1[202u32] r1[203u32] r1[204u32] r1[205u32] r1[206u32] r1[207u32] r1[208u32] r1[209u32] r1[210u32] r1[211u32] r1[212u32] r1[213u32] r1[214u32] r1[215u32] r1[216u32] r1[217u32] r1[218u32] r1[219u32] r1[220u32] r1[221u32] r1[222u32] r1[223u32] r1[224u32] r1[225u32] r1[226u32] r1[227u32] r1[228u32] r1[229u32] r1[230u32] r1[231u32] r1[232u32] r1[233u32] r1[234u32] r1[235u32] r1[236u32] r1[237u32] r1[238u32] r1[239u32] r1[240u32] r1[241u32] r1[242u32] r1[243u32] r1[244u32] r1[245u32] r1[246u32] r1[247u32] r1[248u32] r1[249u32] r1[250u32] r1[251u32] r1[252u32] r1[253u32] r1[254u32] r1[255u32] r1[256u32] r1[257u32] r1[258u32] r1[259u32] r1[260u32] r1[261u32] r1[262u32] r1[263u32] r1[264u32] r1[265u32] r1[266u32] r1[267u32] r1[268u32] r1[269u32] r1[270u32] r1[271u32] r1[272u32] r1[273u32] r1[274u32] r1[275u32] r1[276u32] r1[277u32] r1[278u32] r1[279u32] r1[280u32] r1[281u32] r1[282u32] r1[283u32] r1[284u32] r1[285u32] r1[286u32] r1[287u32] r1[288u32] r1[289u32] r1[290u32] r1[291u32] r1[292u32] r1[293u32] r1[294u32] r1[295u32] r1[296u32] r1[297u32] r1[298u32] r1[299u32] r1[300u32] r1[301u32] r1[302u32] r1[303u32] r1[304u32] r1[305u32] r1[306u32] r1[307u32] r1[308u32] r1[309u32] r1[310u32] r1[311u32] r1[312u32] r1[313u32] r1[314u32] r1[315u32] r1[316u32] r1[317u32] r1[318u32] r1[319u32] r1[320u32] r1[321u32] r1[322u32] r1[323u32] r1[324u32] r1[325u32] r1[326u32] r1[327u32] r1[328u32] r1[329u32] r1[330u32] r1[331u32] r1[332u32] r1[333u32] r1[334u32] r1[335u32] r1[336u32] r1[337u32] r1[338u32] r1[339u32] r1[340u32] r1[341u32] r1[342u32] r1[343u32] r1[344u32] r1[345u32] r1[346u32] r1[347u32] r1[348u32] r1[349u32] r1[350u32] r1[351u32] r1[352u32] r1[353u32] r1[354u32] r1[355u32] r1[356u32] r1[357u32] r1[358u32] r1[359u32] r1[360u32] r1[361u32] r1[362u32] r1[363u32] r1[364u32] r1[365u32] r1[366u32] r1[367u32] r1[368u32] r1[369u32] r1[370u32] r1[371u32] r1[372u32] r1[373u32] r1[374u32] r1[375u32] r1[376u32] r1[377u32] r1[378u32] r1[379u32] r1[380u32] r1[381u32] r1[382u32] r1[383u32] r1[384u32] r1[385u32] r1[386u32] r1[387u32] r1[388u32] r1[389u32] r1[390u32] r1[391u32] r1[392u32] r1[393u32] r1[394u32] r1[395u32] r1[396u32] r1[397u32] r1[398u32] r1[399u32] r1[400u32] r1[401u32] r1[402u32] r1[403u32] r1[404u32] r1[405u32] r1[406u32] r1[407u32] r1[408u32] r1[409u32] r1[410u32] r1[411u32] r1[412u32] r1[413u32] r1[414u32] r1[415u32] r1[416u32] r1[417u32] r1[418u32] r1[419u32] r1[420u32] r1[421u32] r1[422u32] r1[423u32] r1[424u32] r1[425u32] r1[426u32] r1[427u32] r1[428u32] r1[429u32] r1[430u32] r1[431u32] r1[432u32] r1[433u32] r1[434u32] r1[435u32] r1[436u32] r1[437u32] r1[438u32] r1[439u32] r1[440u32] r1[441u32] r1[442u32] r1[443u32] r1[444u32] r1[445u32] r1[446u32] r1[447u32] r1[448u32] r1[449u32] r1[450u32] r1[451u32] r1[452u32] r1[453u32] r1[454u32] r1[455u32] r1[456u32] r1[457u32] r1[458u32] r1[459u32] r1[460u32] r1[461u32] r1[462u32] r1[463u32] r1[464u32] r1[465u32] r1[466u32] r1[467u32] r1[468u32] r1[469u32] r1[470u32] r1[471u32] r1[472u32] r1[473u32] r1[474u32] r1[475u32] r1[476u32] r1[477u32] r1[478u32] r1[479u32] into r26 as [u8; 512u32];\n hash.keccak256.native.raw r26 into r27 as [boolean; 256u32];\n deserialize.bits.raw r27 ([boolean; 256u32]) into r28 ([u8; 32u32]);\n cast 25u8 69u8 116u8 104u8 101u8 114u8 101u8 117u8 109u8 32u8 83u8 105u8 103u8 110u8 101u8 100u8 32u8 77u8 101u8 115u8 115u8 97u8 103u8 101u8 58u8 10u8 51u8 50u8 r28[0u32] r28[1u32] r28[2u32] r28[3u32] r28[4u32] r28[5u32] r28[6u32] r28[7u32] r28[8u32] r28[9u32] r28[10u32] r28[11u32] r28[12u32] r28[13u32] r28[14u32] r28[15u32] r28[16u32] r28[17u32] r28[18u32] r28[19u32] r28[20u32] r28[21u32] r28[22u32] r28[23u32] r28[24u32] r28[25u32] r28[26u32] r28[27u32] r28[28u32] r28[29u32] r28[30u32] r28[31u32] into r29 as [u8; 60u32];\n hash.keccak256.native.raw r29 into r30 as [boolean; 256u32];\n deserialize.bits.raw r30 ([boolean; 256u32]) into r31 ([u8; 32u32]);\n ecdsa.verify.digest.eth r2 r0 r31 into r32;\n assert.eq r32 true;\n cast r0 r12 into r33 as StorageLocationKey;\n add r12 1u8 into r34;\n set true into replay_protection[r8];\n set r1 into storage_locations[r33];\n set r34 into storage_sequences[r11];\n\nconstructor:\n assert.eq edition 0u16;\n`;
22
+ const programRegistry = {
23
+ credits,
24
+ dispatch_proxy,
25
+ hook_manager,
26
+ hyp_collateral,
27
+ hyp_native,
28
+ hyp_synthetic,
29
+ ism_manager,
30
+ mailbox,
31
+ token_registry,
32
+ validator_announce,
33
+ };
34
+ //# sourceMappingURL=artifacts.js.map
35
+
36
+ /***/ }),
37
+
38
+ /***/ 32852:
39
+ /***/ ((__webpack_module__, __webpack_exports__, __webpack_require__) => {
40
+
41
+ __webpack_require__.a(__webpack_module__, async (__webpack_handle_async_dependencies__, __webpack_async_result__) => { try {
42
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
43
+ /* harmony export */ F: () => (/* binding */ AleoProtocolProvider)
44
+ /* harmony export */ });
45
+ /* harmony import */ var _provablehq_sdk_mainnet_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(37645);
46
+ /* harmony import */ var _provablehq_sdk_testnet_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(83684);
47
+ /* harmony import */ var _recoillink_utils__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(21387);
48
+ /* harmony import */ var _hook_hook_artifact_manager_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(799);
49
+ /* harmony import */ var _ism_ism_artifact_manager_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(6439);
50
+ /* harmony import */ var _mailbox_mailbox_artifact_manager_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(19227);
51
+ /* harmony import */ var _utils_helper_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(15952);
52
+ /* harmony import */ var _utils_types_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(96602);
53
+ /* harmony import */ var _validator_announce_validator_announce_artifact_manager_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(34941);
54
+ /* harmony import */ var _warp_warp_artifact_manager_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(41045);
55
+ /* harmony import */ var _provider_node_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(64055);
56
+ /* harmony import */ var _signer_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(67909);
57
+ var __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([_provablehq_sdk_mainnet_js__WEBPACK_IMPORTED_MODULE_0__, _provablehq_sdk_testnet_js__WEBPACK_IMPORTED_MODULE_1__, _hook_hook_artifact_manager_js__WEBPACK_IMPORTED_MODULE_2__, _ism_ism_artifact_manager_js__WEBPACK_IMPORTED_MODULE_3__, _mailbox_mailbox_artifact_manager_js__WEBPACK_IMPORTED_MODULE_4__, _validator_announce_validator_announce_artifact_manager_js__WEBPACK_IMPORTED_MODULE_7__, _warp_warp_artifact_manager_js__WEBPACK_IMPORTED_MODULE_8__, _provider_node_js__WEBPACK_IMPORTED_MODULE_9__, _signer_js__WEBPACK_IMPORTED_MODULE_10__]);
58
+ ([_provablehq_sdk_mainnet_js__WEBPACK_IMPORTED_MODULE_0__, _provablehq_sdk_testnet_js__WEBPACK_IMPORTED_MODULE_1__, _hook_hook_artifact_manager_js__WEBPACK_IMPORTED_MODULE_2__, _ism_ism_artifact_manager_js__WEBPACK_IMPORTED_MODULE_3__, _mailbox_mailbox_artifact_manager_js__WEBPACK_IMPORTED_MODULE_4__, _validator_announce_validator_announce_artifact_manager_js__WEBPACK_IMPORTED_MODULE_7__, _warp_warp_artifact_manager_js__WEBPACK_IMPORTED_MODULE_8__, _provider_node_js__WEBPACK_IMPORTED_MODULE_9__, _signer_js__WEBPACK_IMPORTED_MODULE_10__] = __webpack_async_dependencies__.then ? (await __webpack_async_dependencies__)() : __webpack_async_dependencies__);
59
+
60
+
61
+
62
+
63
+
64
+
65
+
66
+
67
+
68
+
69
+
70
+
71
+ // Base router deploy cost in native denom (microcredits), used to size
72
+ // getMinGas().WARP_DEPLOY_GAS. The composable per-config breakdown lives on
73
+ // AleoProvider.getMinGasForWarpDeploy.
74
+ const WARP_DEPLOY_BASE_MICROCREDITS = 0n;
75
+ class AleoProtocolProvider {
76
+ createProvider(chainMetadata) {
77
+ return _provider_node_js__WEBPACK_IMPORTED_MODULE_9__/* .AleoProvider */ .t.connect(chainMetadata);
78
+ }
79
+ async createSigner(chainMetadata, config) {
80
+ const { privateKey } = config;
81
+ return _signer_js__WEBPACK_IMPORTED_MODULE_10__/* .AleoSigner */ .C.connectWithSigner(chainMetadata, privateKey);
82
+ }
83
+ createSubmitter(_chainMetadata, _config) {
84
+ // @TODO Implement in a follow up PR
85
+ throw Error('Not implemented');
86
+ }
87
+ createIsmArtifactManager(chainMetadata) {
88
+ const chainId = parseInt(chainMetadata.chainId.toString());
89
+ (0,_recoillink_utils__WEBPACK_IMPORTED_MODULE_11__/* .assert */ .v)(chainId === _utils_types_js__WEBPACK_IMPORTED_MODULE_6__/* .AleoNetworkId */ .lH.MAINNET || chainId === _utils_types_js__WEBPACK_IMPORTED_MODULE_6__/* .AleoNetworkId */ .lH.TESTNET, `Unknown chain id ${chainId} for Aleo, only ${_utils_types_js__WEBPACK_IMPORTED_MODULE_6__/* .AleoNetworkId */ .lH.MAINNET} or ${_utils_types_js__WEBPACK_IMPORTED_MODULE_6__/* .AleoNetworkId */ .lH.TESTNET} allowed`);
90
+ const [rpcUrl] = chainMetadata.rpcUrls?.map(({ http }) => http) ?? [];
91
+ (0,_recoillink_utils__WEBPACK_IMPORTED_MODULE_11__/* .assert */ .v)(rpcUrl, `got no rpcUrls`);
92
+ const aleoClient = chainId === _utils_types_js__WEBPACK_IMPORTED_MODULE_6__/* .AleoNetworkId */ .lH.MAINNET
93
+ ? new _provablehq_sdk_mainnet_js__WEBPACK_IMPORTED_MODULE_0__.AleoNetworkClient(rpcUrl)
94
+ : new _provablehq_sdk_testnet_js__WEBPACK_IMPORTED_MODULE_1__.AleoNetworkClient(rpcUrl);
95
+ return new _ism_ism_artifact_manager_js__WEBPACK_IMPORTED_MODULE_3__/* .AleoIsmArtifactManager */ .k(aleoClient);
96
+ }
97
+ createHookArtifactManager(chainMetadata, context) {
98
+ const chainId = parseInt(chainMetadata.chainId.toString());
99
+ (0,_recoillink_utils__WEBPACK_IMPORTED_MODULE_11__/* .assert */ .v)(chainId === _utils_types_js__WEBPACK_IMPORTED_MODULE_6__/* .AleoNetworkId */ .lH.MAINNET || chainId === _utils_types_js__WEBPACK_IMPORTED_MODULE_6__/* .AleoNetworkId */ .lH.TESTNET, `Unknown chain id ${chainId} for Aleo, only ${_utils_types_js__WEBPACK_IMPORTED_MODULE_6__/* .AleoNetworkId */ .lH.MAINNET} or ${_utils_types_js__WEBPACK_IMPORTED_MODULE_6__/* .AleoNetworkId */ .lH.TESTNET} allowed`);
100
+ const [rpcUrl] = chainMetadata.rpcUrls?.map(({ http }) => http) ?? [];
101
+ (0,_recoillink_utils__WEBPACK_IMPORTED_MODULE_11__/* .assert */ .v)(rpcUrl, 'got no rpcUrls');
102
+ const aleoClient = chainId === _utils_types_js__WEBPACK_IMPORTED_MODULE_6__/* .AleoNetworkId */ .lH.MAINNET
103
+ ? new _provablehq_sdk_mainnet_js__WEBPACK_IMPORTED_MODULE_0__.AleoNetworkClient(rpcUrl)
104
+ : new _provablehq_sdk_testnet_js__WEBPACK_IMPORTED_MODULE_1__.AleoNetworkClient(rpcUrl);
105
+ return new _hook_hook_artifact_manager_js__WEBPACK_IMPORTED_MODULE_2__/* .AleoHookArtifactManager */ .c(aleoClient, context?.mailbox);
106
+ }
107
+ createWarpArtifactManager(chainMetadata, context) {
108
+ const chainId = parseInt(chainMetadata.chainId.toString());
109
+ (0,_recoillink_utils__WEBPACK_IMPORTED_MODULE_11__/* .assert */ .v)(chainId === _utils_types_js__WEBPACK_IMPORTED_MODULE_6__/* .AleoNetworkId */ .lH.MAINNET || chainId === _utils_types_js__WEBPACK_IMPORTED_MODULE_6__/* .AleoNetworkId */ .lH.TESTNET, `Unknown chain id ${chainId} for Aleo, only ${_utils_types_js__WEBPACK_IMPORTED_MODULE_6__/* .AleoNetworkId */ .lH.MAINNET} or ${_utils_types_js__WEBPACK_IMPORTED_MODULE_6__/* .AleoNetworkId */ .lH.TESTNET} allowed`);
110
+ const [rpcUrl] = chainMetadata.rpcUrls?.map(({ http }) => http) ?? [];
111
+ (0,_recoillink_utils__WEBPACK_IMPORTED_MODULE_11__/* .assert */ .v)(rpcUrl, 'got no rpcUrls');
112
+ const aleoClient = chainId === _utils_types_js__WEBPACK_IMPORTED_MODULE_6__/* .AleoNetworkId */ .lH.MAINNET
113
+ ? new _provablehq_sdk_mainnet_js__WEBPACK_IMPORTED_MODULE_0__.AleoNetworkClient(rpcUrl)
114
+ : new _provablehq_sdk_testnet_js__WEBPACK_IMPORTED_MODULE_1__.AleoNetworkClient(rpcUrl);
115
+ const prefix = (0,_utils_helper_js__WEBPACK_IMPORTED_MODULE_5__/* .getNetworkPrefix */ .nA)(chainId);
116
+ const customIsmSuffix = process.env['ALEO_ISM_MANAGER_SUFFIX'];
117
+ const ismManagerAddress = customIsmSuffix
118
+ ? `${prefix}_ism_manager_${customIsmSuffix}.aleo`
119
+ : `${prefix}_ism_manager.aleo`;
120
+ // Prefer deriving hook manager from mailbox suffix if mailbox is provided.
121
+ // Fall back to unsuffixed hook manager when context is unavailable.
122
+ const hookManagerAddress = context?.mailbox
123
+ ? (0,_utils_helper_js__WEBPACK_IMPORTED_MODULE_5__/* .getProgramIdFromSuffix */ .Ne)(prefix, 'hook_manager', (0,_utils_helper_js__WEBPACK_IMPORTED_MODULE_5__/* .getProgramSuffix */ .GC)((0,_utils_helper_js__WEBPACK_IMPORTED_MODULE_5__/* .fromAleoAddress */ .kz)(context.mailbox).programId))
124
+ : `${prefix}_hook_manager.aleo`;
125
+ return new _warp_warp_artifact_manager_js__WEBPACK_IMPORTED_MODULE_8__/* .AleoWarpArtifactManager */ .V(aleoClient, {
126
+ ismManagerAddress,
127
+ hookManagerAddress,
128
+ });
129
+ }
130
+ createMailboxArtifactManager(chainMetadata) {
131
+ const aleoNetworkId = (0,_utils_types_js__WEBPACK_IMPORTED_MODULE_6__/* .toAleoNetworkId */ .e0)(parseInt(chainMetadata.chainId.toString()));
132
+ const [rpcUrl] = chainMetadata.rpcUrls?.map(({ http }) => http) ?? [];
133
+ (0,_recoillink_utils__WEBPACK_IMPORTED_MODULE_11__/* .assert */ .v)(rpcUrl, 'got no rpcUrls');
134
+ const aleoClient = aleoNetworkId === _utils_types_js__WEBPACK_IMPORTED_MODULE_6__/* .AleoNetworkId */ .lH.MAINNET
135
+ ? new _provablehq_sdk_mainnet_js__WEBPACK_IMPORTED_MODULE_0__.AleoNetworkClient(rpcUrl)
136
+ : new _provablehq_sdk_testnet_js__WEBPACK_IMPORTED_MODULE_1__.AleoNetworkClient(rpcUrl);
137
+ return new _mailbox_mailbox_artifact_manager_js__WEBPACK_IMPORTED_MODULE_4__/* .AleoMailboxArtifactManager */ .F({ domainId: chainMetadata.domainId, aleoNetworkId }, aleoClient);
138
+ }
139
+ createValidatorAnnounceArtifactManager(chainMetadata) {
140
+ const aleoNetworkId = (0,_utils_types_js__WEBPACK_IMPORTED_MODULE_6__/* .toAleoNetworkId */ .e0)(parseInt(chainMetadata.chainId.toString()));
141
+ const [rpcUrl] = chainMetadata.rpcUrls?.map(({ http }) => http) ?? [];
142
+ (0,_recoillink_utils__WEBPACK_IMPORTED_MODULE_11__/* .assert */ .v)(rpcUrl, 'got no rpcUrls');
143
+ const aleoClient = aleoNetworkId === _utils_types_js__WEBPACK_IMPORTED_MODULE_6__/* .AleoNetworkId */ .lH.MAINNET
144
+ ? new _provablehq_sdk_mainnet_js__WEBPACK_IMPORTED_MODULE_0__.AleoNetworkClient(rpcUrl)
145
+ : new _provablehq_sdk_testnet_js__WEBPACK_IMPORTED_MODULE_1__.AleoNetworkClient(rpcUrl);
146
+ return new _validator_announce_validator_announce_artifact_manager_js__WEBPACK_IMPORTED_MODULE_7__/* .AleoValidatorAnnounceArtifactManager */ .q({ domainId: chainMetadata.domainId, aleoNetworkId }, aleoClient);
147
+ }
148
+ createFeeArtifactManager(_chainMetadata, _context) {
149
+ return null;
150
+ }
151
+ getMinGas() {
152
+ return {
153
+ CORE_DEPLOY_GAS: 0n,
154
+ WARP_DEPLOY_GAS: WARP_DEPLOY_BASE_MICROCREDITS,
155
+ TEST_SEND_GAS: 0n,
156
+ AVS_GAS: 0n,
157
+ ISM_DEPLOY_GAS: 0n,
158
+ HOOK_DEPLOY_GAS: 0n,
159
+ };
160
+ }
161
+ }
162
+ //# sourceMappingURL=protocol.js.map
163
+ __webpack_async_result__();
164
+ } catch(e) { __webpack_async_result__(e); } });
165
+
166
+ /***/ }),
167
+
168
+ /***/ 67909:
169
+ /***/ ((__webpack_module__, __webpack_exports__, __webpack_require__) => {
170
+
171
+ __webpack_require__.a(__webpack_module__, async (__webpack_handle_async_dependencies__, __webpack_async_result__) => { try {
172
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
173
+ /* harmony export */ C: () => (/* binding */ AleoSigner)
174
+ /* harmony export */ });
175
+ /* harmony import */ var _recoillink_provider_sdk_warp__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(17791);
176
+ /* harmony import */ var _recoillink_utils__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(21387);
177
+ /* harmony import */ var _recoillink_utils__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(73689);
178
+ /* harmony import */ var _recoillink_utils__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(14918);
179
+ /* harmony import */ var _utils_helper_node_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(83345);
180
+ /* harmony import */ var _utils_helper_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(15952);
181
+ /* harmony import */ var _provider_node_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(64055);
182
+ var __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([_utils_helper_node_js__WEBPACK_IMPORTED_MODULE_1__, _provider_node_js__WEBPACK_IMPORTED_MODULE_3__]);
183
+ ([_utils_helper_node_js__WEBPACK_IMPORTED_MODULE_1__, _provider_node_js__WEBPACK_IMPORTED_MODULE_3__] = __webpack_async_dependencies__.then ? (await __webpack_async_dependencies__)() : __webpack_async_dependencies__);
184
+
185
+
186
+
187
+
188
+
189
+ class AleoSigner extends _provider_node_js__WEBPACK_IMPORTED_MODULE_3__/* .AleoProvider */ .t {
190
+ static WARP_SUFFIX_ALREADY_DEPLOYED_ERROR = 'already deployed, please choose another suffix';
191
+ programManager;
192
+ static async connectWithSigner(metadata, privateKey) {
193
+ (0,_recoillink_utils__WEBPACK_IMPORTED_MODULE_4__/* .assert */ .v)(!(0,_recoillink_utils__WEBPACK_IMPORTED_MODULE_5__/* .isNullish */ .u)(metadata.chainId), `chainId not defined in chain metadata`);
194
+ const rpcUrls = (metadata.rpcUrls ?? []).map((rpc) => rpc.http);
195
+ return new AleoSigner(rpcUrls, metadata, privateKey);
196
+ }
197
+ constructor(rpcUrls, chainMetadata, privateKey) {
198
+ super(rpcUrls, chainMetadata.chainId, chainMetadata);
199
+ this.programManager = this.getProgramManager(privateKey);
200
+ }
201
+ async getIsmManager() {
202
+ // Use the configured ISM manager program ID (from env or default)
203
+ const ismManagerProgramId = this.ismManager;
204
+ // Check if it's already deployed
205
+ const isDeployed = await this.isProgramDeployed(ismManagerProgramId);
206
+ if (!isDeployed) {
207
+ const suffix = (0,_utils_helper_js__WEBPACK_IMPORTED_MODULE_2__/* .getProgramSuffix */ .GC)(ismManagerProgramId);
208
+ await this.deployProgram('ism_manager', suffix);
209
+ }
210
+ return ismManagerProgramId;
211
+ }
212
+ async isProgramDeployed(programId) {
213
+ try {
214
+ await this.aleoClient.getProgram(programId);
215
+ return true;
216
+ }
217
+ catch {
218
+ return false;
219
+ }
220
+ }
221
+ isProgramAlreadyExistsError(err, programId) {
222
+ return (err instanceof Error &&
223
+ err.message.includes('already exists on the network') &&
224
+ err.message.includes(programId));
225
+ }
226
+ async getWarpTokenSuffix(tokenType, preferredSuffix, maxAttempts = 20) {
227
+ if (tokenType === _recoillink_provider_sdk_warp__WEBPACK_IMPORTED_MODULE_0__/* .TokenType */ .ks.native) {
228
+ return 'credits';
229
+ }
230
+ // If a file override is set, validate the override program isn't already deployed
231
+ const warpProgram = tokenType === _recoillink_provider_sdk_warp__WEBPACK_IMPORTED_MODULE_0__/* .TokenType */ .ks.collateral ? 'hyp_collateral' : 'hyp_synthetic';
232
+ const overrideProgramId = (0,_utils_helper_node_js__WEBPACK_IMPORTED_MODULE_1__/* .getFileOverrideProgramId */ .gi)(warpProgram);
233
+ if (overrideProgramId) {
234
+ const isDeployed = await this.isProgramDeployed(overrideProgramId);
235
+ (0,_recoillink_utils__WEBPACK_IMPORTED_MODULE_4__/* .assert */ .v)(!isDeployed, `${overrideProgramId} ${AleoSigner.WARP_SUFFIX_ALREADY_DEPLOYED_ERROR}`);
236
+ return ''; // suffix unused — program name comes from the override file
237
+ }
238
+ const configuredSuffix = preferredSuffix || this.warpSuffix;
239
+ if (configuredSuffix) {
240
+ const tokenProgramId = `${this.prefix}_warp_token_${configuredSuffix}.aleo`;
241
+ const isAlreadyDeployed = await this.isProgramDeployed(tokenProgramId);
242
+ (0,_recoillink_utils__WEBPACK_IMPORTED_MODULE_4__/* .assert */ .v)(!isAlreadyDeployed, `Warp route with suffix ${configuredSuffix} ${AleoSigner.WARP_SUFFIX_ALREADY_DEPLOYED_ERROR}`);
243
+ return configuredSuffix;
244
+ }
245
+ for (let i = 0; i < maxAttempts; i++) {
246
+ const suffix = this.generateSuffix(_utils_helper_js__WEBPACK_IMPORTED_MODULE_2__/* .SUFFIX_LENGTH_LONG */ .SO);
247
+ const tokenProgramId = `${this.prefix}_warp_token_${suffix}.aleo`;
248
+ if (!(await this.isProgramDeployed(tokenProgramId))) {
249
+ return suffix;
250
+ }
251
+ }
252
+ throw new Error(`Could not find an unused suffix for ${tokenType} after ${maxAttempts} attempts`);
253
+ }
254
+ async deployProgram(programName, coreSuffix, warpSuffix) {
255
+ const programs = (0,_utils_helper_node_js__WEBPACK_IMPORTED_MODULE_1__/* .loadProgramsInDeployOrder */ .wR)(this.prefix, programName, coreSuffix, warpSuffix);
256
+ for (const { id, program } of programs) {
257
+ if (await this.isProgramDeployed(id)) {
258
+ continue;
259
+ }
260
+ try {
261
+ const tx = this.skipProofs
262
+ ? await this.programManager.buildDevnodeDeploymentTransaction({
263
+ program,
264
+ priorityFee: 0,
265
+ privateFee: false,
266
+ })
267
+ : await this.programManager.buildDeploymentTransaction(program, 0, false, undefined, undefined, undefined);
268
+ const txId = await this.programManager.networkClient.submitTransaction(tx);
269
+ await this.aleoClient.waitForTransactionConfirmation(txId);
270
+ }
271
+ catch (err) {
272
+ if (this.isProgramAlreadyExistsError(err, id)) {
273
+ continue;
274
+ }
275
+ throw err;
276
+ }
277
+ }
278
+ return programs.reduce((acc, p) => ({ ...acc, [p.name]: p.id }), {});
279
+ }
280
+ getSignerAddress() {
281
+ return this.programManager.account.address().to_string();
282
+ }
283
+ getNetworkPrefix() {
284
+ return this.prefix;
285
+ }
286
+ /**
287
+ * Get the hook manager program ID for a given mailbox suffix.
288
+ * Deploys the hook_manager program if it's not already deployed.
289
+ *
290
+ * @param suffix - The mailbox suffix
291
+ * @returns The hook manager program ID
292
+ */
293
+ async getHookManager(suffix) {
294
+ const programs = await this.deployProgram('hook_manager', suffix);
295
+ const hookManagerProgramId = programs['hook_manager'];
296
+ (0,_recoillink_utils__WEBPACK_IMPORTED_MODULE_4__/* .assert */ .v)(hookManagerProgramId, `hook_manager program not deployed`);
297
+ return hookManagerProgramId;
298
+ }
299
+ supportsTransactionBatching() {
300
+ return false;
301
+ }
302
+ async transactionToPrintableJson(transaction) {
303
+ return transaction;
304
+ }
305
+ async sendAndConfirmTransaction(transaction) {
306
+ const tx = this.skipProofs
307
+ ? await this.programManager.buildDevnodeExecutionTransaction(transaction)
308
+ : await this.programManager.buildExecutionTransaction(transaction);
309
+ const txId = await (0,_recoillink_utils__WEBPACK_IMPORTED_MODULE_6__/* .retryAsync */ .tH)(() => this.programManager.networkClient.submitTransaction(tx), _utils_helper_js__WEBPACK_IMPORTED_MODULE_2__/* .RETRY_ATTEMPTS */ .Km, _utils_helper_js__WEBPACK_IMPORTED_MODULE_2__/* .RETRY_DELAY_MS */ .k);
310
+ const receipt = await this.aleoClient.waitForTransactionConfirmation(txId);
311
+ return {
312
+ ...receipt,
313
+ transactionHash: receipt.transaction.id,
314
+ };
315
+ }
316
+ async sendAndConfirmBatchTransactions(_transactions) {
317
+ throw new Error(`${AleoSigner.name} does not support transaction batching`);
318
+ }
319
+ }
320
+ //# sourceMappingURL=signer.js.map
321
+ __webpack_async_result__();
322
+ } catch(e) { __webpack_async_result__(e); } });
323
+
324
+ /***/ }),
325
+
326
+ /***/ 36320:
327
+ /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
328
+
329
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
330
+ /* harmony export */ k: () => (/* binding */ getNewHookAddress)
331
+ /* harmony export */ });
332
+ /* harmony import */ var _recoillink_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(14918);
333
+ /* harmony import */ var _utils_helper_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(15952);
334
+
335
+
336
+ /**
337
+ * Get the newly created hook address after hook creation transaction.
338
+ * This should be called AFTER the hook creation transaction has been confirmed.
339
+ *
340
+ * @param aleoClient - The Aleo network client
341
+ * @param hookManagerProgramId - The hook manager program ID
342
+ * @param nonce - The nonce captured before hook creation
343
+ * @returns The full hook address (e.g., "hook_manager_xxx.aleo/aleo1...")
344
+ *
345
+ * @example
346
+ * ```typescript
347
+ * const expectedNonce = await getNewContractExpectedNonce(client, hookManagerProgramId);
348
+ * const receipt = await signer.sendAndConfirmTransaction(createHookTx);
349
+ * const hookAddress = await getNewHookAddress(client, hookManagerProgramId, expectedNonce);
350
+ * ```
351
+ */
352
+ async function getNewHookAddress(aleoClient, hookManagerProgramId, nonce) {
353
+ const hookAddressRaw = await (0,_recoillink_utils__WEBPACK_IMPORTED_MODULE_1__/* .retryAsync */ .tH)(async () => {
354
+ const result = await aleoClient.getProgramMappingValue(hookManagerProgramId, 'hook_addresses', nonce);
355
+ if (result === null) {
356
+ throw new Error(`could not read hook address with nonce ${nonce} from hook_manager ${hookManagerProgramId}`);
357
+ }
358
+ return result;
359
+ }, _utils_helper_js__WEBPACK_IMPORTED_MODULE_0__/* .RETRY_ATTEMPTS */ .Km, _utils_helper_js__WEBPACK_IMPORTED_MODULE_0__/* .RETRY_DELAY_MS */ .k);
360
+ return `${hookManagerProgramId}/${hookAddressRaw}`;
361
+ }
362
+ //# sourceMappingURL=base.js.map
363
+
364
+ /***/ }),
365
+
366
+ /***/ 799:
367
+ /***/ ((__webpack_module__, __webpack_exports__, __webpack_require__) => {
368
+
369
+ __webpack_require__.a(__webpack_module__, async (__webpack_handle_async_dependencies__, __webpack_async_result__) => { try {
370
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
371
+ /* harmony export */ c: () => (/* binding */ AleoHookArtifactManager)
372
+ /* harmony export */ });
373
+ /* harmony import */ var _recoillink_provider_sdk__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(75859);
374
+ /* harmony import */ var _recoillink_provider_sdk_hook__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(77230);
375
+ /* harmony import */ var _recoillink_utils__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(21387);
376
+ /* harmony import */ var _hook_query_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(31743);
377
+ /* harmony import */ var _igp_hook_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(14277);
378
+ /* harmony import */ var _merkle_tree_hook_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(7558);
379
+ var __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([_hook_query_js__WEBPACK_IMPORTED_MODULE_2__, _igp_hook_js__WEBPACK_IMPORTED_MODULE_3__, _merkle_tree_hook_js__WEBPACK_IMPORTED_MODULE_4__]);
380
+ ([_hook_query_js__WEBPACK_IMPORTED_MODULE_2__, _igp_hook_js__WEBPACK_IMPORTED_MODULE_3__, _merkle_tree_hook_js__WEBPACK_IMPORTED_MODULE_4__] = __webpack_async_dependencies__.then ? (await __webpack_async_dependencies__)() : __webpack_async_dependencies__);
381
+
382
+
383
+
384
+
385
+
386
+
387
+ /**
388
+ * Aleo Hook Artifact Manager implementing IRawHookArtifactManager.
389
+ *
390
+ * This manager:
391
+ * - Provides factory methods for creating type-specific hook readers and writers
392
+ * - Supports IGP and MerkleTree hook types
393
+ * - Automatically detects hook type when reading deployed hooks
394
+ *
395
+ * Design: The mailbox address is optional at construction and only validated
396
+ * when creating writers for deployment. This allows the manager to be used
397
+ * for read-only operations without requiring deployment context.
398
+ */
399
+ class AleoHookArtifactManager {
400
+ aleoClient;
401
+ mailboxAddress;
402
+ constructor(aleoClient, mailboxAddress) {
403
+ this.aleoClient = aleoClient;
404
+ this.mailboxAddress = mailboxAddress;
405
+ }
406
+ async readHook(address) {
407
+ // Detect hook type first
408
+ const aleoHookType = await (0,_hook_query_js__WEBPACK_IMPORTED_MODULE_2__/* .getHookType */ .cz)(this.aleoClient, address);
409
+ if (aleoHookType === _recoillink_provider_sdk__WEBPACK_IMPORTED_MODULE_0__/* .AltVM.HookType */ .bx.WD.CUSTOM ||
410
+ aleoHookType === _recoillink_provider_sdk__WEBPACK_IMPORTED_MODULE_0__/* .AltVM.HookType */ .bx.WD.PAUSABLE) {
411
+ return (0,_recoillink_provider_sdk_hook__WEBPACK_IMPORTED_MODULE_1__/* .throwUnsupportedHookType */ .DD)(aleoHookType, 'Aleo');
412
+ }
413
+ // Get the appropriate reader and read the hook
414
+ const reader = this.createReader((0,_recoillink_provider_sdk_hook__WEBPACK_IMPORTED_MODULE_1__/* .altVmHookTypeToProviderHookType */ .nJ)(aleoHookType));
415
+ return reader.read(address);
416
+ }
417
+ createReader(type) {
418
+ const readers = {
419
+ [_recoillink_provider_sdk__WEBPACK_IMPORTED_MODULE_0__/* .AltVM.HookType */ .bx.WD.MERKLE_TREE]: () => new _merkle_tree_hook_js__WEBPACK_IMPORTED_MODULE_4__/* .AleoMerkleTreeHookReader */ .W(this.aleoClient),
420
+ [_recoillink_provider_sdk__WEBPACK_IMPORTED_MODULE_0__/* .AltVM.HookType */ .bx.WD.INTERCHAIN_GAS_PAYMASTER]: () => new _igp_hook_js__WEBPACK_IMPORTED_MODULE_3__/* .AleoIgpHookReader */ .q(this.aleoClient),
421
+ };
422
+ const reader = readers[type];
423
+ if (!reader) {
424
+ return (0,_recoillink_provider_sdk_hook__WEBPACK_IMPORTED_MODULE_1__/* .throwUnsupportedHookType */ .DD)(type, 'Aleo');
425
+ }
426
+ return reader();
427
+ }
428
+ createWriter(type, signer) {
429
+ const mailboxAddress = this.mailboxAddress;
430
+ (0,_recoillink_utils__WEBPACK_IMPORTED_MODULE_5__/* .assert */ .v)(mailboxAddress, 'mailbox address required for hook deployment');
431
+ const writers = {
432
+ [_recoillink_provider_sdk__WEBPACK_IMPORTED_MODULE_0__/* .AltVM.HookType */ .bx.WD.MERKLE_TREE]: () => new _merkle_tree_hook_js__WEBPACK_IMPORTED_MODULE_4__/* .AleoMerkleTreeHookWriter */ .D(this.aleoClient, signer, mailboxAddress),
433
+ [_recoillink_provider_sdk__WEBPACK_IMPORTED_MODULE_0__/* .AltVM.HookType */ .bx.WD.INTERCHAIN_GAS_PAYMASTER]: () => new _igp_hook_js__WEBPACK_IMPORTED_MODULE_3__/* .AleoIgpHookWriter */ .s(this.aleoClient, signer, mailboxAddress),
434
+ };
435
+ const writer = writers[type];
436
+ if (!writer) {
437
+ return (0,_recoillink_provider_sdk_hook__WEBPACK_IMPORTED_MODULE_1__/* .throwUnsupportedHookType */ .DD)(type, 'Aleo');
438
+ }
439
+ return writer();
440
+ }
441
+ }
442
+ //# sourceMappingURL=hook-artifact-manager.js.map
443
+ __webpack_async_result__();
444
+ } catch(e) { __webpack_async_result__(e); } });
445
+
446
+ /***/ }),
447
+
448
+ /***/ 31743:
449
+ /***/ ((__webpack_module__, __webpack_exports__, __webpack_require__) => {
450
+
451
+ __webpack_require__.a(__webpack_module__, async (__webpack_handle_async_dependencies__, __webpack_async_result__) => { try {
452
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
453
+ /* harmony export */ Iz: () => (/* binding */ getMerkleTreeHookConfig),
454
+ /* harmony export */ Og: () => (/* binding */ getIgpHookConfig),
455
+ /* harmony export */ cz: () => (/* binding */ getHookType)
456
+ /* harmony export */ });
457
+ /* harmony import */ var _recoillink_provider_sdk__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(75859);
458
+ /* harmony import */ var _recoillink_utils__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(21387);
459
+ /* harmony import */ var _utils_base_query_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(40363);
460
+ /* harmony import */ var _utils_helper_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(15952);
461
+ /* harmony import */ var _utils_types_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(96602);
462
+ var __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([_utils_base_query_js__WEBPACK_IMPORTED_MODULE_1__]);
463
+ _utils_base_query_js__WEBPACK_IMPORTED_MODULE_1__ = (__webpack_async_dependencies__.then ? (await __webpack_async_dependencies__)() : __webpack_async_dependencies__)[0];
464
+
465
+
466
+
467
+
468
+
469
+ /**
470
+ * Type guard to check if a number is a valid AleoHookType
471
+ */
472
+ function isAleoHookType(maybeHookType) {
473
+ switch (maybeHookType) {
474
+ case _utils_types_js__WEBPACK_IMPORTED_MODULE_3__/* .AleoHookType */ .b2.CUSTOM:
475
+ case _utils_types_js__WEBPACK_IMPORTED_MODULE_3__/* .AleoHookType */ .b2.MERKLE_TREE:
476
+ case _utils_types_js__WEBPACK_IMPORTED_MODULE_3__/* .AleoHookType */ .b2.INTERCHAIN_GAS_PAYMASTER:
477
+ case _utils_types_js__WEBPACK_IMPORTED_MODULE_3__/* .AleoHookType */ .b2.PAUSABLE:
478
+ return true;
479
+ }
480
+ return false;
481
+ }
482
+ /**
483
+ * Query the hook type for a given hook address.
484
+ *
485
+ * @param aleoClient - The Aleo network client
486
+ * @param hookAddress - The full hook address (e.g., "hook_manager.aleo/aleo1...")
487
+ * @returns The hook type
488
+ */
489
+ async function getHookType(aleoClient, hookAddress) {
490
+ const { address, programId } = (0,_utils_helper_js__WEBPACK_IMPORTED_MODULE_2__/* .fromAleoAddress */ .kz)(hookAddress);
491
+ const result = await (0,_utils_base_query_js__WEBPACK_IMPORTED_MODULE_1__/* .queryMappingValue */ .YR)(aleoClient, programId, 'hooks', address, (raw) => {
492
+ (0,_recoillink_utils__WEBPACK_IMPORTED_MODULE_4__/* .assert */ .v)(typeof raw === 'number', `Expected hook type to be a number but got ${typeof raw}`);
493
+ return raw;
494
+ });
495
+ (0,_recoillink_utils__WEBPACK_IMPORTED_MODULE_4__/* .assert */ .v)(isAleoHookType(result), `Unknown hook type ${result} for address: ${hookAddress}`);
496
+ switch (result) {
497
+ case _utils_types_js__WEBPACK_IMPORTED_MODULE_3__/* .AleoHookType */ .b2.CUSTOM:
498
+ return _recoillink_provider_sdk__WEBPACK_IMPORTED_MODULE_0__/* .AltVM.HookType */ .bx.WD.CUSTOM;
499
+ case _utils_types_js__WEBPACK_IMPORTED_MODULE_3__/* .AleoHookType */ .b2.MERKLE_TREE:
500
+ return _recoillink_provider_sdk__WEBPACK_IMPORTED_MODULE_0__/* .AltVM.HookType */ .bx.WD.MERKLE_TREE;
501
+ case _utils_types_js__WEBPACK_IMPORTED_MODULE_3__/* .AleoHookType */ .b2.INTERCHAIN_GAS_PAYMASTER:
502
+ return _recoillink_provider_sdk__WEBPACK_IMPORTED_MODULE_0__/* .AltVM.HookType */ .bx.WD.INTERCHAIN_GAS_PAYMASTER;
503
+ case _utils_types_js__WEBPACK_IMPORTED_MODULE_3__/* .AleoHookType */ .b2.PAUSABLE:
504
+ return _recoillink_provider_sdk__WEBPACK_IMPORTED_MODULE_0__/* .AltVM.HookType */ .bx.WD.PAUSABLE;
505
+ default:
506
+ throw new Error(`Unknown hook type ${result} for address: ${hookAddress}`);
507
+ }
508
+ }
509
+ /**
510
+ * Query the configuration for a MerkleTree hook.
511
+ *
512
+ * @param aleoClient - The Aleo network client
513
+ * @param hookAddress - The full hook address (e.g., "hook_manager.aleo/aleo1...")
514
+ * @returns The MerkleTree hook configuration
515
+ */
516
+ async function getMerkleTreeHookConfig(aleoClient, hookAddress) {
517
+ const hookType = await getHookType(aleoClient, hookAddress);
518
+ (0,_recoillink_utils__WEBPACK_IMPORTED_MODULE_4__/* .assert */ .v)(hookType === _recoillink_provider_sdk__WEBPACK_IMPORTED_MODULE_0__/* .AltVM.HookType */ .bx.WD.MERKLE_TREE, `Expected MerkleTree hook but got ${hookType} at address ${hookAddress}`);
519
+ return {
520
+ type: _utils_types_js__WEBPACK_IMPORTED_MODULE_3__/* .AleoHookType */ .b2.MERKLE_TREE,
521
+ address: hookAddress,
522
+ };
523
+ }
524
+ /**
525
+ * Query the configuration for an IGP (Interchain Gas Paymaster) hook.
526
+ *
527
+ * @param aleoClient - The Aleo network client
528
+ * @param hookAddress - The full hook address (e.g., "hook_manager.aleo/aleo1...")
529
+ * @returns The IGP hook configuration with owner and destination gas configs
530
+ */
531
+ async function getIgpHookConfig(aleoClient, hookAddress) {
532
+ const hookType = await getHookType(aleoClient, hookAddress);
533
+ (0,_recoillink_utils__WEBPACK_IMPORTED_MODULE_4__/* .assert */ .v)(hookType === _recoillink_provider_sdk__WEBPACK_IMPORTED_MODULE_0__/* .AltVM.HookType */ .bx.WD.INTERCHAIN_GAS_PAYMASTER, `Expected IGP hook but got ${hookType} at address ${hookAddress}`);
534
+ const { programId, address } = (0,_utils_helper_js__WEBPACK_IMPORTED_MODULE_2__/* .fromAleoAddress */ .kz)(hookAddress);
535
+ const destinationGasConfigs = {};
536
+ const igpData = await (0,_utils_base_query_js__WEBPACK_IMPORTED_MODULE_1__/* .queryMappingValue */ .YR)(aleoClient, programId, 'igps', address, (raw) => {
537
+ const igpData = raw;
538
+ (0,_recoillink_utils__WEBPACK_IMPORTED_MODULE_4__/* .assert */ .v)(igpData?.hook_owner, `Invalid IGP data structure for hook ${hookAddress}, expected object with hook_owner field`);
539
+ return igpData;
540
+ });
541
+ const owner = igpData.hook_owner;
542
+ const gasConfigLength = await (0,_utils_base_query_js__WEBPACK_IMPORTED_MODULE_1__/* .tryQueryMappingValue */ .jD)(aleoClient, programId, 'destination_gas_config_length', address, (raw) => raw);
543
+ for (let i = 0; i < (gasConfigLength || 0); i++) {
544
+ const gasConfigKey = await aleoClient.getProgramMappingPlaintext(programId, 'destination_gas_config_iter', `{hook:${address},index:${i}u32}`);
545
+ const destinationGasConfig = await (0,_utils_base_query_js__WEBPACK_IMPORTED_MODULE_1__/* .tryQueryMappingValue */ .jD)(aleoClient, programId, 'destination_gas_configs', gasConfigKey.toString(), (raw) => raw);
546
+ // This is necessary because `destination_gas_config_iter` maintains keys for all destination domain entries,
547
+ // including those from domains that have already been removed. When a domain is
548
+ // deleted from the Destination Gas Configs, its key remains in the map and `destination_gas_configs` simply returns null.
549
+ if (!destinationGasConfig)
550
+ continue;
551
+ destinationGasConfigs[gasConfigKey.toObject().destination] = {
552
+ gasOracle: {
553
+ tokenExchangeRate: destinationGasConfig.exchange_rate.toString(),
554
+ gasPrice: destinationGasConfig.gas_price.toString(),
555
+ },
556
+ gasOverhead: destinationGasConfig.gas_overhead.toString(),
557
+ };
558
+ }
559
+ return {
560
+ type: _utils_types_js__WEBPACK_IMPORTED_MODULE_3__/* .AleoHookType */ .b2.INTERCHAIN_GAS_PAYMASTER,
561
+ address: hookAddress,
562
+ owner,
563
+ destinationGasConfigs,
564
+ };
565
+ }
566
+ //# sourceMappingURL=hook-query.js.map
567
+ __webpack_async_result__();
568
+ } catch(e) { __webpack_async_result__(e); } });
569
+
570
+ /***/ }),
571
+
572
+ /***/ 30647:
573
+ /***/ ((__webpack_module__, __webpack_exports__, __webpack_require__) => {
574
+
575
+ __webpack_require__.a(__webpack_module__, async (__webpack_handle_async_dependencies__, __webpack_async_result__) => { try {
576
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
577
+ /* harmony export */ Bl: () => (/* binding */ getSetIgpHookOwnerTx),
578
+ /* harmony export */ Y$: () => (/* binding */ getRemoveDestinationGasConfigTx),
579
+ /* harmony export */ Yw: () => (/* binding */ getSetDestinationGasConfigTx),
580
+ /* harmony export */ eX: () => (/* binding */ getCreateIgpHookTx),
581
+ /* harmony export */ sI: () => (/* binding */ getCreateMerkleTreeHookTx)
582
+ /* harmony export */ });
583
+ /* harmony import */ var _utils_helper_crypto_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(44996);
584
+ /* harmony import */ var _utils_helper_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(15952);
585
+ var __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([_utils_helper_crypto_js__WEBPACK_IMPORTED_MODULE_0__]);
586
+ _utils_helper_crypto_js__WEBPACK_IMPORTED_MODULE_0__ = (__webpack_async_dependencies__.then ? (await __webpack_async_dependencies__)() : __webpack_async_dependencies__)[0];
587
+
588
+
589
+ /**
590
+ * Build transaction to create a MerkleTree hook
591
+ *
592
+ * @param hookManagerProgramId - The hook manager program ID
593
+ * @param dispatchProxyProgramId - The dispatch proxy program ID
594
+ * @returns The transaction object
595
+ */
596
+ function getCreateMerkleTreeHookTx(hookManagerProgramId, dispatchProxyProgramId) {
597
+ return {
598
+ programName: hookManagerProgramId,
599
+ functionName: 'init_merkle_tree',
600
+ priorityFee: 0,
601
+ privateFee: false,
602
+ inputs: [(0,_utils_helper_crypto_js__WEBPACK_IMPORTED_MODULE_0__/* .getAddressFromProgramId */ ._D)(dispatchProxyProgramId)],
603
+ };
604
+ }
605
+ /**
606
+ * Build transaction to create an IGP (InterchainGasPaymaster) hook
607
+ *
608
+ * @param hookManagerProgramId - The hook manager program ID
609
+ * @returns The transaction object
610
+ */
611
+ function getCreateIgpHookTx(hookManagerProgramId) {
612
+ return {
613
+ programName: hookManagerProgramId,
614
+ functionName: 'init_igp',
615
+ priorityFee: 0,
616
+ privateFee: false,
617
+ inputs: [],
618
+ };
619
+ }
620
+ /**
621
+ * Build transaction to set IGP hook owner
622
+ *
623
+ * @param hookAddress - The full hook address (e.g., "hook_manager.aleo/aleo1...")
624
+ * @param newOwner - The new owner address
625
+ * @returns The transaction object
626
+ */
627
+ function getSetIgpHookOwnerTx(hookAddress, newOwner) {
628
+ const { programId, address } = (0,_utils_helper_js__WEBPACK_IMPORTED_MODULE_1__/* .fromAleoAddress */ .kz)(hookAddress);
629
+ return {
630
+ programName: programId,
631
+ functionName: 'transfer_igp_ownership',
632
+ priorityFee: 0,
633
+ privateFee: false,
634
+ inputs: [address, newOwner],
635
+ };
636
+ }
637
+ /**
638
+ * Build transaction to set destination gas configuration
639
+ *
640
+ * @param hookAddress - The full hook address (e.g., "hook_manager.aleo/aleo1...")
641
+ * @param gasConfig - The gas configuration for the destination
642
+ * @returns The transaction object
643
+ */
644
+ function getSetDestinationGasConfigTx(hookAddress, gasConfig) {
645
+ const { programId, address } = (0,_utils_helper_js__WEBPACK_IMPORTED_MODULE_1__/* .fromAleoAddress */ .kz)(hookAddress);
646
+ return {
647
+ programName: programId,
648
+ functionName: 'set_destination_gas_config',
649
+ priorityFee: 0,
650
+ privateFee: false,
651
+ inputs: [
652
+ address,
653
+ `${gasConfig.remoteDomainId}u32`,
654
+ `{gas_overhead:${gasConfig.gasOverhead}u128,exchange_rate:${gasConfig.tokenExchangeRate}u128,gas_price:${gasConfig.gasPrice}u128}`,
655
+ ],
656
+ };
657
+ }
658
+ /**
659
+ * Build transaction to remove destination gas configuration
660
+ *
661
+ * @param hookAddress - The full hook address (e.g., "hook_manager.aleo/aleo1...")
662
+ * @param remoteDomainId - The remote domain ID to remove
663
+ * @returns The transaction object
664
+ */
665
+ function getRemoveDestinationGasConfigTx(hookAddress, remoteDomainId) {
666
+ const { programId, address } = (0,_utils_helper_js__WEBPACK_IMPORTED_MODULE_1__/* .fromAleoAddress */ .kz)(hookAddress);
667
+ return {
668
+ programName: programId,
669
+ functionName: 'remove_destination_gas_config',
670
+ priorityFee: 0,
671
+ privateFee: false,
672
+ inputs: [address, `${remoteDomainId}u32`],
673
+ };
674
+ }
675
+ //# sourceMappingURL=hook-tx.js.map
676
+ __webpack_async_result__();
677
+ } catch(e) { __webpack_async_result__(e); } });
678
+
679
+ /***/ }),
680
+
681
+ /***/ 14277:
682
+ /***/ ((__webpack_module__, __webpack_exports__, __webpack_require__) => {
683
+
684
+ __webpack_require__.a(__webpack_module__, async (__webpack_handle_async_dependencies__, __webpack_async_result__) => { try {
685
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
686
+ /* harmony export */ q: () => (/* binding */ AleoIgpHookReader),
687
+ /* harmony export */ s: () => (/* binding */ AleoIgpHookWriter)
688
+ /* harmony export */ });
689
+ /* harmony import */ var _recoillink_provider_sdk__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(75859);
690
+ /* harmony import */ var _recoillink_provider_sdk_artifact__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(4287);
691
+ /* harmony import */ var _recoillink_utils__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(93142);
692
+ /* harmony import */ var _recoillink_utils__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(73689);
693
+ /* harmony import */ var _utils_base_query_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(40363);
694
+ /* harmony import */ var _utils_helper_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(15952);
695
+ /* harmony import */ var _base_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(36320);
696
+ /* harmony import */ var _hook_query_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(31743);
697
+ /* harmony import */ var _hook_tx_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(30647);
698
+ var __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([_utils_base_query_js__WEBPACK_IMPORTED_MODULE_2__, _hook_query_js__WEBPACK_IMPORTED_MODULE_5__, _hook_tx_js__WEBPACK_IMPORTED_MODULE_6__]);
699
+ ([_utils_base_query_js__WEBPACK_IMPORTED_MODULE_2__, _hook_query_js__WEBPACK_IMPORTED_MODULE_5__, _hook_tx_js__WEBPACK_IMPORTED_MODULE_6__] = __webpack_async_dependencies__.then ? (await __webpack_async_dependencies__)() : __webpack_async_dependencies__);
700
+
701
+
702
+
703
+
704
+
705
+
706
+
707
+
708
+ class AleoIgpHookReader {
709
+ aleoClient;
710
+ constructor(aleoClient) {
711
+ this.aleoClient = aleoClient;
712
+ }
713
+ async read(address) {
714
+ const hookConfig = await (0,_hook_query_js__WEBPACK_IMPORTED_MODULE_5__/* .getIgpHookConfig */ .Og)(this.aleoClient, address);
715
+ // Map Aleo config to provider-sdk format
716
+ const overhead = {};
717
+ const oracleConfig = {};
718
+ for (const [domainId, gasConfig] of Object.entries(hookConfig.destinationGasConfigs)) {
719
+ overhead[domainId] = parseInt(gasConfig.gasOverhead);
720
+ oracleConfig[domainId] = {
721
+ gasPrice: gasConfig.gasOracle.gasPrice,
722
+ tokenExchangeRate: gasConfig.gasOracle.tokenExchangeRate,
723
+ };
724
+ }
725
+ return {
726
+ artifactState: _recoillink_provider_sdk_artifact__WEBPACK_IMPORTED_MODULE_1__/* .ArtifactState */ .O2.DEPLOYED,
727
+ config: {
728
+ type: _recoillink_provider_sdk__WEBPACK_IMPORTED_MODULE_0__/* .AltVM.HookType */ .bx.WD.INTERCHAIN_GAS_PAYMASTER,
729
+ owner: hookConfig.owner,
730
+ // Aleo IGP doesn't have beneficiary and oracleKey in the same way as EVM
731
+ // Setting them to owner as a placeholder
732
+ beneficiary: hookConfig.owner,
733
+ oracleKey: hookConfig.owner,
734
+ overhead,
735
+ oracleConfig,
736
+ },
737
+ deployed: {
738
+ address: hookConfig.address,
739
+ },
740
+ };
741
+ }
742
+ }
743
+ class AleoIgpHookWriter extends AleoIgpHookReader {
744
+ signer;
745
+ mailboxAddress;
746
+ constructor(aleoClient, signer, mailboxAddress) {
747
+ super(aleoClient);
748
+ this.signer = signer;
749
+ this.mailboxAddress = mailboxAddress;
750
+ }
751
+ async create(artifact) {
752
+ const { programId } = (0,_utils_helper_js__WEBPACK_IMPORTED_MODULE_3__/* .fromAleoAddress */ .kz)(this.mailboxAddress);
753
+ const suffix = (0,_utils_helper_js__WEBPACK_IMPORTED_MODULE_3__/* .getProgramSuffix */ .GC)(programId);
754
+ const hookManagerProgramId = await this.signer.getHookManager(suffix);
755
+ const transaction = (0,_hook_tx_js__WEBPACK_IMPORTED_MODULE_6__/* .getCreateIgpHookTx */ .eX)(hookManagerProgramId);
756
+ const expectedNonce = await (0,_utils_base_query_js__WEBPACK_IMPORTED_MODULE_2__/* .getNewContractExpectedNonce */ .Qj)(this.aleoClient, hookManagerProgramId);
757
+ const receipt = await this.signer.sendAndConfirmTransaction(transaction);
758
+ const hookAddress = await (0,_base_js__WEBPACK_IMPORTED_MODULE_4__/* .getNewHookAddress */ .k)(this.aleoClient, hookManagerProgramId, expectedNonce);
759
+ const receipts = [receipt];
760
+ // Set destination gas configs
761
+ for (const [domainId, gasOverhead] of Object.entries(artifact.config.overhead)) {
762
+ const parsedDomainId = parseInt(domainId);
763
+ const oracleConfig = artifact.config.oracleConfig[parsedDomainId];
764
+ if (!oracleConfig) {
765
+ throw new Error(`Missing oracle config for domain ${domainId}`);
766
+ }
767
+ const gasConfigTx = (0,_hook_tx_js__WEBPACK_IMPORTED_MODULE_6__/* .getSetDestinationGasConfigTx */ .Yw)(hookAddress, {
768
+ remoteDomainId: parsedDomainId,
769
+ gasOverhead: gasOverhead.toString(),
770
+ tokenExchangeRate: oracleConfig.tokenExchangeRate,
771
+ gasPrice: oracleConfig.gasPrice,
772
+ });
773
+ const gasConfigReceipt = await this.signer.sendAndConfirmTransaction(gasConfigTx);
774
+ receipts.push(gasConfigReceipt);
775
+ }
776
+ // Transfer ownership if needed (deployer is initial owner)
777
+ const deployerAddress = this.signer.getSignerAddress();
778
+ if (!(0,_recoillink_utils__WEBPACK_IMPORTED_MODULE_7__/* .eqAddressAleo */ .qI)(artifact.config.owner, deployerAddress)) {
779
+ const ownerTx = (0,_hook_tx_js__WEBPACK_IMPORTED_MODULE_6__/* .getSetIgpHookOwnerTx */ .Bl)(hookAddress, artifact.config.owner);
780
+ const ownerReceipt = await this.signer.sendAndConfirmTransaction(ownerTx);
781
+ receipts.push(ownerReceipt);
782
+ }
783
+ const deployedArtifact = {
784
+ artifactState: _recoillink_provider_sdk_artifact__WEBPACK_IMPORTED_MODULE_1__/* .ArtifactState */ .O2.DEPLOYED,
785
+ config: artifact.config,
786
+ deployed: {
787
+ address: hookAddress,
788
+ },
789
+ };
790
+ return [deployedArtifact, receipts];
791
+ }
792
+ async update(artifact) {
793
+ const current = await this.read(artifact.deployed.address);
794
+ const transactions = [];
795
+ // Handle destination gas config updates first
796
+ const currentOverhead = current.config.overhead;
797
+ const desiredOverhead = artifact.config.overhead;
798
+ const currentOracleConfig = current.config.oracleConfig;
799
+ const desiredOracleConfig = artifact.config.oracleConfig;
800
+ // Remove configs that are no longer needed
801
+ const domainsToRemove = Object.keys(currentOverhead).filter((domainId) => (0,_recoillink_utils__WEBPACK_IMPORTED_MODULE_8__/* .isNullish */ .u)(desiredOverhead[parseInt(domainId)]));
802
+ for (const domainId of domainsToRemove) {
803
+ transactions.push({
804
+ annotation: `Removing destination gas config for domain ${domainId}`,
805
+ ...(0,_hook_tx_js__WEBPACK_IMPORTED_MODULE_6__/* .getRemoveDestinationGasConfigTx */ .Y$)(artifact.deployed.address, parseInt(domainId)),
806
+ });
807
+ }
808
+ // Add or update configs
809
+ for (const [domainId, gasOverhead] of Object.entries(desiredOverhead)) {
810
+ const parsedDomainId = parseInt(domainId);
811
+ const oracleConfig = desiredOracleConfig[parsedDomainId];
812
+ if (!oracleConfig) {
813
+ throw new Error(`Missing oracle config for domain ${domainId}`);
814
+ }
815
+ const currentGasOverhead = currentOverhead[parsedDomainId];
816
+ const currentOracle = currentOracleConfig[parsedDomainId];
817
+ // Check if config changed
818
+ const configChanged = currentGasOverhead !== gasOverhead ||
819
+ (0,_recoillink_utils__WEBPACK_IMPORTED_MODULE_8__/* .isNullish */ .u)(currentOracle) ||
820
+ currentOracle.gasPrice !== oracleConfig.gasPrice ||
821
+ currentOracle.tokenExchangeRate !== oracleConfig.tokenExchangeRate;
822
+ if (configChanged) {
823
+ transactions.push({
824
+ annotation: `Setting destination gas config for domain ${domainId}`,
825
+ ...(0,_hook_tx_js__WEBPACK_IMPORTED_MODULE_6__/* .getSetDestinationGasConfigTx */ .Yw)(artifact.deployed.address, {
826
+ remoteDomainId: parseInt(domainId),
827
+ gasOverhead: gasOverhead.toString(),
828
+ tokenExchangeRate: oracleConfig.tokenExchangeRate,
829
+ gasPrice: oracleConfig.gasPrice,
830
+ }),
831
+ });
832
+ }
833
+ }
834
+ // Transfer ownership last if changed
835
+ if (!(0,_recoillink_utils__WEBPACK_IMPORTED_MODULE_7__/* .eqAddressAleo */ .qI)(artifact.config.owner, current.config.owner)) {
836
+ transactions.push({
837
+ annotation: `Setting IGP hook owner to ${artifact.config.owner}`,
838
+ ...(0,_hook_tx_js__WEBPACK_IMPORTED_MODULE_6__/* .getSetIgpHookOwnerTx */ .Bl)(artifact.deployed.address, artifact.config.owner),
839
+ });
840
+ }
841
+ return transactions;
842
+ }
843
+ }
844
+ //# sourceMappingURL=igp-hook.js.map
845
+ __webpack_async_result__();
846
+ } catch(e) { __webpack_async_result__(e); } });
847
+
848
+ /***/ }),
849
+
850
+ /***/ 7558:
851
+ /***/ ((__webpack_module__, __webpack_exports__, __webpack_require__) => {
852
+
853
+ __webpack_require__.a(__webpack_module__, async (__webpack_handle_async_dependencies__, __webpack_async_result__) => { try {
854
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
855
+ /* harmony export */ D: () => (/* binding */ AleoMerkleTreeHookWriter),
856
+ /* harmony export */ W: () => (/* binding */ AleoMerkleTreeHookReader)
857
+ /* harmony export */ });
858
+ /* harmony import */ var _recoillink_provider_sdk__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(75859);
859
+ /* harmony import */ var _recoillink_provider_sdk_artifact__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(4287);
860
+ /* harmony import */ var _utils_base_query_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(40363);
861
+ /* harmony import */ var _utils_helper_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(15952);
862
+ /* harmony import */ var _base_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(36320);
863
+ /* harmony import */ var _hook_query_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(31743);
864
+ /* harmony import */ var _hook_tx_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(30647);
865
+ var __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([_utils_base_query_js__WEBPACK_IMPORTED_MODULE_2__, _hook_query_js__WEBPACK_IMPORTED_MODULE_5__, _hook_tx_js__WEBPACK_IMPORTED_MODULE_6__]);
866
+ ([_utils_base_query_js__WEBPACK_IMPORTED_MODULE_2__, _hook_query_js__WEBPACK_IMPORTED_MODULE_5__, _hook_tx_js__WEBPACK_IMPORTED_MODULE_6__] = __webpack_async_dependencies__.then ? (await __webpack_async_dependencies__)() : __webpack_async_dependencies__);
867
+
868
+
869
+
870
+
871
+
872
+
873
+
874
+ class AleoMerkleTreeHookReader {
875
+ aleoClient;
876
+ constructor(aleoClient) {
877
+ this.aleoClient = aleoClient;
878
+ }
879
+ async read(address) {
880
+ const hookConfig = await (0,_hook_query_js__WEBPACK_IMPORTED_MODULE_5__/* .getMerkleTreeHookConfig */ .Iz)(this.aleoClient, address);
881
+ return {
882
+ artifactState: _recoillink_provider_sdk_artifact__WEBPACK_IMPORTED_MODULE_1__/* .ArtifactState */ .O2.DEPLOYED,
883
+ config: {
884
+ type: _recoillink_provider_sdk__WEBPACK_IMPORTED_MODULE_0__/* .AltVM.HookType */ .bx.WD.MERKLE_TREE,
885
+ },
886
+ deployed: {
887
+ address: hookConfig.address,
888
+ },
889
+ };
890
+ }
891
+ }
892
+ class AleoMerkleTreeHookWriter extends AleoMerkleTreeHookReader {
893
+ signer;
894
+ mailboxAddress;
895
+ constructor(aleoClient, signer, mailboxAddress) {
896
+ super(aleoClient);
897
+ this.signer = signer;
898
+ this.mailboxAddress = mailboxAddress;
899
+ }
900
+ async create(artifact) {
901
+ const { programId } = (0,_utils_helper_js__WEBPACK_IMPORTED_MODULE_3__/* .fromAleoAddress */ .kz)(this.mailboxAddress);
902
+ const suffix = (0,_utils_helper_js__WEBPACK_IMPORTED_MODULE_3__/* .getProgramSuffix */ .GC)(programId);
903
+ const prefix = this.signer.getNetworkPrefix();
904
+ const hookManagerProgramId = await this.signer.getHookManager(suffix);
905
+ const dispatchProxyProgramId = (0,_utils_helper_js__WEBPACK_IMPORTED_MODULE_3__/* .getProgramIdFromSuffix */ .Ne)(prefix, 'dispatch_proxy', suffix);
906
+ const transaction = (0,_hook_tx_js__WEBPACK_IMPORTED_MODULE_6__/* .getCreateMerkleTreeHookTx */ .sI)(hookManagerProgramId, dispatchProxyProgramId);
907
+ const expectedNonce = await (0,_utils_base_query_js__WEBPACK_IMPORTED_MODULE_2__/* .getNewContractExpectedNonce */ .Qj)(this.aleoClient, hookManagerProgramId);
908
+ const receipt = await this.signer.sendAndConfirmTransaction(transaction);
909
+ const hookAddress = await (0,_base_js__WEBPACK_IMPORTED_MODULE_4__/* .getNewHookAddress */ .k)(this.aleoClient, hookManagerProgramId, expectedNonce);
910
+ const deployedArtifact = {
911
+ artifactState: _recoillink_provider_sdk_artifact__WEBPACK_IMPORTED_MODULE_1__/* .ArtifactState */ .O2.DEPLOYED,
912
+ config: artifact.config,
913
+ deployed: {
914
+ address: hookAddress,
915
+ },
916
+ };
917
+ return [deployedArtifact, [receipt]];
918
+ }
919
+ async update(_artifact) {
920
+ // MerkleTreeHook has no mutable state
921
+ return [];
922
+ }
923
+ }
924
+ //# sourceMappingURL=merkle-tree-hook.js.map
925
+ __webpack_async_result__();
926
+ } catch(e) { __webpack_async_result__(e); } });
927
+
928
+ /***/ }),
929
+
930
+ /***/ 59529:
931
+ /***/ ((__webpack_module__, __webpack_exports__, __webpack_require__) => {
932
+
933
+ __webpack_require__.a(__webpack_module__, async (__webpack_handle_async_dependencies__, __webpack_async_result__) => { try {
934
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
935
+ /* harmony export */ AleoProtocolProvider: () => (/* reexport safe */ _clients_protocol_js__WEBPACK_IMPORTED_MODULE_1__.F)
936
+ /* harmony export */ });
937
+ /* harmony import */ var _utils_helper_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(15952);
938
+ /* harmony import */ var _clients_protocol_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(32852);
939
+ /* harmony import */ var _clients_provider_node_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(64055);
940
+ /* harmony import */ var _clients_signer_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(67909);
941
+ /* harmony import */ var _ism_ism_artifact_manager_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(6439);
942
+ /* harmony import */ var _hook_hook_artifact_manager_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(799);
943
+ /* harmony import */ var _hook_merkle_tree_hook_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(7558);
944
+ /* harmony import */ var _hook_igp_hook_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(14277);
945
+ /* harmony import */ var _warp_warp_artifact_manager_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(41045);
946
+ /* harmony import */ var _mailbox_mailbox_artifact_manager_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(19227);
947
+ /* harmony import */ var _mailbox_mailbox_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(10990);
948
+ /* harmony import */ var _validator_announce_validator_announce_artifact_manager_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(34941);
949
+ /* harmony import */ var _validator_announce_validator_announce_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(69404);
950
+ var __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([_clients_protocol_js__WEBPACK_IMPORTED_MODULE_1__, _clients_provider_node_js__WEBPACK_IMPORTED_MODULE_2__, _clients_signer_js__WEBPACK_IMPORTED_MODULE_3__, _ism_ism_artifact_manager_js__WEBPACK_IMPORTED_MODULE_4__, _hook_hook_artifact_manager_js__WEBPACK_IMPORTED_MODULE_5__, _hook_merkle_tree_hook_js__WEBPACK_IMPORTED_MODULE_6__, _hook_igp_hook_js__WEBPACK_IMPORTED_MODULE_7__, _warp_warp_artifact_manager_js__WEBPACK_IMPORTED_MODULE_8__, _mailbox_mailbox_artifact_manager_js__WEBPACK_IMPORTED_MODULE_9__, _mailbox_mailbox_js__WEBPACK_IMPORTED_MODULE_10__, _validator_announce_validator_announce_artifact_manager_js__WEBPACK_IMPORTED_MODULE_11__, _validator_announce_validator_announce_js__WEBPACK_IMPORTED_MODULE_12__]);
951
+ ([_clients_protocol_js__WEBPACK_IMPORTED_MODULE_1__, _clients_provider_node_js__WEBPACK_IMPORTED_MODULE_2__, _clients_signer_js__WEBPACK_IMPORTED_MODULE_3__, _ism_ism_artifact_manager_js__WEBPACK_IMPORTED_MODULE_4__, _hook_hook_artifact_manager_js__WEBPACK_IMPORTED_MODULE_5__, _hook_merkle_tree_hook_js__WEBPACK_IMPORTED_MODULE_6__, _hook_igp_hook_js__WEBPACK_IMPORTED_MODULE_7__, _warp_warp_artifact_manager_js__WEBPACK_IMPORTED_MODULE_8__, _mailbox_mailbox_artifact_manager_js__WEBPACK_IMPORTED_MODULE_9__, _mailbox_mailbox_js__WEBPACK_IMPORTED_MODULE_10__, _validator_announce_validator_announce_artifact_manager_js__WEBPACK_IMPORTED_MODULE_11__, _validator_announce_validator_announce_js__WEBPACK_IMPORTED_MODULE_12__] = __webpack_async_dependencies__.then ? (await __webpack_async_dependencies__)() : __webpack_async_dependencies__);
952
+
953
+
954
+
955
+
956
+
957
+
958
+
959
+
960
+
961
+
962
+
963
+
964
+
965
+ //# sourceMappingURL=index.js.map
966
+ __webpack_async_result__();
967
+ } catch(e) { __webpack_async_result__(e); } });
968
+
969
+ /***/ }),
970
+
971
+ /***/ 4980:
972
+ /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
973
+
974
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
975
+ /* harmony export */ q: () => (/* binding */ getNewIsmAddress)
976
+ /* harmony export */ });
977
+ /* harmony import */ var _recoillink_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(14918);
978
+ /* harmony import */ var _utils_helper_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(15952);
979
+
980
+
981
+ /**
982
+ * Retrieves the address of a newly created ISM from the ISM manager contract.
983
+ *
984
+ * This function queries the ISM manager's nonce to get the current count of created ISMs,
985
+ * then uses that nonce to look up the most recently created ISM address from the
986
+ * `ism_addresses` mapping.
987
+ *
988
+ * @param aleoClient - The Aleo network client for querying contract state
989
+ * @param ismManagerProgramId - The program ID of the ISM manager contract
990
+ * @returns The full ISM address in the format "programId/address"
991
+ * @throws Error if the ISM address cannot be read from the ISM manager
992
+ */
993
+ async function getNewIsmAddress(aleoClient, ismManagerProgramId, nonce) {
994
+ const ismAddressRaw = await (0,_recoillink_utils__WEBPACK_IMPORTED_MODULE_1__/* .retryAsync */ .tH)(async () => {
995
+ const result = await aleoClient.getProgramMappingValue(ismManagerProgramId, 'ism_addresses', nonce);
996
+ if (result === null) {
997
+ throw new Error(`could not read ism address with nonce ${nonce} from ism_manager`);
998
+ }
999
+ return result;
1000
+ }, _utils_helper_js__WEBPACK_IMPORTED_MODULE_0__/* .RETRY_ATTEMPTS */ .Km, _utils_helper_js__WEBPACK_IMPORTED_MODULE_0__/* .RETRY_DELAY_MS */ .k);
1001
+ return `${ismManagerProgramId}/${ismAddressRaw}`;
1002
+ }
1003
+ //# sourceMappingURL=base.js.map
1004
+
1005
+ /***/ }),
1006
+
1007
+ /***/ 6439:
1008
+ /***/ ((__webpack_module__, __webpack_exports__, __webpack_require__) => {
1009
+
1010
+ __webpack_require__.a(__webpack_module__, async (__webpack_handle_async_dependencies__, __webpack_async_result__) => { try {
1011
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
1012
+ /* harmony export */ k: () => (/* binding */ AleoIsmArtifactManager)
1013
+ /* harmony export */ });
1014
+ /* harmony import */ var _recoillink_provider_sdk__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(75859);
1015
+ /* harmony import */ var _recoillink_provider_sdk_ism__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(96426);
1016
+ /* harmony import */ var _utils_types_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(96602);
1017
+ /* harmony import */ var _ism_query_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(5575);
1018
+ /* harmony import */ var _multisig_ism_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(86873);
1019
+ /* harmony import */ var _routing_ism_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(71793);
1020
+ /* harmony import */ var _test_ism_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(27271);
1021
+ var __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([_ism_query_js__WEBPACK_IMPORTED_MODULE_3__, _multisig_ism_js__WEBPACK_IMPORTED_MODULE_4__, _routing_ism_js__WEBPACK_IMPORTED_MODULE_5__, _test_ism_js__WEBPACK_IMPORTED_MODULE_6__]);
1022
+ ([_ism_query_js__WEBPACK_IMPORTED_MODULE_3__, _multisig_ism_js__WEBPACK_IMPORTED_MODULE_4__, _routing_ism_js__WEBPACK_IMPORTED_MODULE_5__, _test_ism_js__WEBPACK_IMPORTED_MODULE_6__] = __webpack_async_dependencies__.then ? (await __webpack_async_dependencies__)() : __webpack_async_dependencies__);
1023
+
1024
+
1025
+
1026
+
1027
+
1028
+
1029
+
1030
+ /**
1031
+ * Maps Aleo-specific ISM type values to provider-sdk ISM types.
1032
+ */
1033
+ function aleoIsmTypeToAltVmType(aleoType) {
1034
+ switch (aleoType) {
1035
+ case _utils_types_js__WEBPACK_IMPORTED_MODULE_2__/* .AleoIsmType */ .Jt.MESSAGE_ID_MULTISIG:
1036
+ return _recoillink_provider_sdk__WEBPACK_IMPORTED_MODULE_0__/* .AltVM.IsmType */ .bx.GO.MESSAGE_ID_MULTISIG;
1037
+ case _utils_types_js__WEBPACK_IMPORTED_MODULE_2__/* .AleoIsmType */ .Jt.ROUTING:
1038
+ return _recoillink_provider_sdk__WEBPACK_IMPORTED_MODULE_0__/* .AltVM.IsmType */ .bx.GO.ROUTING;
1039
+ case _utils_types_js__WEBPACK_IMPORTED_MODULE_2__/* .AleoIsmType */ .Jt.TEST_ISM:
1040
+ return _recoillink_provider_sdk__WEBPACK_IMPORTED_MODULE_0__/* .AltVM.IsmType */ .bx.GO.TEST_ISM;
1041
+ case _utils_types_js__WEBPACK_IMPORTED_MODULE_2__/* .AleoIsmType */ .Jt.MERKLE_ROOT_MULTISIG:
1042
+ throw new Error(`${_recoillink_provider_sdk__WEBPACK_IMPORTED_MODULE_0__/* .AltVM.IsmType */ .bx.GO.MERKLE_ROOT_MULTISIG} is not supported on Aleo`);
1043
+ default:
1044
+ throw new Error(`Unknown Aleo ISM type: ${aleoType}`);
1045
+ }
1046
+ }
1047
+ class AleoIsmArtifactManager {
1048
+ aleoClient;
1049
+ constructor(aleoClient) {
1050
+ this.aleoClient = aleoClient;
1051
+ }
1052
+ async readIsm(address) {
1053
+ const aleoIsmType = await (0,_ism_query_js__WEBPACK_IMPORTED_MODULE_3__/* .getIsmType */ .gi)(this.aleoClient, address);
1054
+ const altVMType = aleoIsmTypeToAltVmType(aleoIsmType);
1055
+ const artifactIsmType = (0,_recoillink_provider_sdk_ism__WEBPACK_IMPORTED_MODULE_1__/* .altVMIsmTypeToProviderSdkType */ .EJ)(altVMType);
1056
+ const reader = this.createReader(artifactIsmType);
1057
+ return reader.read(address);
1058
+ }
1059
+ createReader(type) {
1060
+ switch (type) {
1061
+ case _recoillink_provider_sdk__WEBPACK_IMPORTED_MODULE_0__/* .AltVM.IsmType */ .bx.GO.TEST_ISM:
1062
+ return new _test_ism_js__WEBPACK_IMPORTED_MODULE_6__/* .AleoTestIsmReader */ .G(this.aleoClient);
1063
+ case _recoillink_provider_sdk__WEBPACK_IMPORTED_MODULE_0__/* .AltVM.IsmType */ .bx.GO.MESSAGE_ID_MULTISIG:
1064
+ return new _multisig_ism_js__WEBPACK_IMPORTED_MODULE_4__/* .AleoMessageIdMultisigIsmReader */ .a(this.aleoClient);
1065
+ case _recoillink_provider_sdk__WEBPACK_IMPORTED_MODULE_0__/* .AltVM.IsmType */ .bx.GO.ROUTING:
1066
+ return new _routing_ism_js__WEBPACK_IMPORTED_MODULE_5__/* .AleoRoutingIsmRawReader */ .Y(this.aleoClient);
1067
+ default:
1068
+ throw new Error(`Unsupported ISM type: ${type}`);
1069
+ }
1070
+ }
1071
+ createWriter(type, signer) {
1072
+ switch (type) {
1073
+ case _recoillink_provider_sdk__WEBPACK_IMPORTED_MODULE_0__/* .AltVM.IsmType */ .bx.GO.TEST_ISM:
1074
+ return new _test_ism_js__WEBPACK_IMPORTED_MODULE_6__/* .AleoTestIsmWriter */ .S(this.aleoClient, signer);
1075
+ case _recoillink_provider_sdk__WEBPACK_IMPORTED_MODULE_0__/* .AltVM.IsmType */ .bx.GO.MESSAGE_ID_MULTISIG:
1076
+ return new _multisig_ism_js__WEBPACK_IMPORTED_MODULE_4__/* .AleoMessageIdMultisigIsmWriter */ ._(this.aleoClient, signer);
1077
+ case _recoillink_provider_sdk__WEBPACK_IMPORTED_MODULE_0__/* .AltVM.IsmType */ .bx.GO.ROUTING:
1078
+ return new _routing_ism_js__WEBPACK_IMPORTED_MODULE_5__/* .AleoRoutingIsmRawWriter */ .I(this.aleoClient, signer);
1079
+ default:
1080
+ throw new Error(`Unsupported ISM type: ${type}`);
1081
+ }
1082
+ }
1083
+ }
1084
+ //# sourceMappingURL=ism-artifact-manager.js.map
1085
+ __webpack_async_result__();
1086
+ } catch(e) { __webpack_async_result__(e); } });
1087
+
1088
+ /***/ }),
1089
+
1090
+ /***/ 5575:
1091
+ /***/ ((__webpack_module__, __webpack_exports__, __webpack_require__) => {
1092
+
1093
+ __webpack_require__.a(__webpack_module__, async (__webpack_handle_async_dependencies__, __webpack_async_result__) => { try {
1094
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
1095
+ /* harmony export */ CA: () => (/* binding */ getTestIsmConfig),
1096
+ /* harmony export */ Ev: () => (/* binding */ getRoutingIsmConfig),
1097
+ /* harmony export */ gi: () => (/* binding */ getIsmType),
1098
+ /* harmony export */ oC: () => (/* binding */ getMessageIdMultisigIsmConfig)
1099
+ /* harmony export */ });
1100
+ /* harmony import */ var _recoillink_utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(21387);
1101
+ /* harmony import */ var _recoillink_utils__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(73689);
1102
+ /* harmony import */ var _recoillink_utils__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(93142);
1103
+ /* harmony import */ var _utils_base_query_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(40363);
1104
+ /* harmony import */ var _utils_helper_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(15952);
1105
+ /* harmony import */ var _utils_types_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(96602);
1106
+ var __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([_utils_base_query_js__WEBPACK_IMPORTED_MODULE_0__]);
1107
+ _utils_base_query_js__WEBPACK_IMPORTED_MODULE_0__ = (__webpack_async_dependencies__.then ? (await __webpack_async_dependencies__)() : __webpack_async_dependencies__)[0];
1108
+
1109
+
1110
+
1111
+
1112
+ /**
1113
+ * Type guard to check if a number is a valid AleoIsmType
1114
+ */
1115
+ function isAleoIsmType(maybeIsmType) {
1116
+ switch (maybeIsmType) {
1117
+ case _utils_types_js__WEBPACK_IMPORTED_MODULE_2__/* .AleoIsmType */ .Jt.TEST_ISM:
1118
+ case _utils_types_js__WEBPACK_IMPORTED_MODULE_2__/* .AleoIsmType */ .Jt.ROUTING:
1119
+ case _utils_types_js__WEBPACK_IMPORTED_MODULE_2__/* .AleoIsmType */ .Jt.MERKLE_ROOT_MULTISIG:
1120
+ case _utils_types_js__WEBPACK_IMPORTED_MODULE_2__/* .AleoIsmType */ .Jt.MESSAGE_ID_MULTISIG:
1121
+ return true;
1122
+ }
1123
+ return false;
1124
+ }
1125
+ /**
1126
+ * Query the ISM type for a given ISM address.
1127
+ *
1128
+ * @param aleoClient - The Aleo network client
1129
+ * @param ismAddress - The full ISM address (e.g., "ism_manager.aleo/aleo1...")
1130
+ * @returns The ISM type
1131
+ */
1132
+ async function getIsmType(aleoClient, ismAddress) {
1133
+ const { address, programId } = (0,_utils_helper_js__WEBPACK_IMPORTED_MODULE_1__/* .fromAleoAddress */ .kz)(ismAddress);
1134
+ const result = await (0,_utils_base_query_js__WEBPACK_IMPORTED_MODULE_0__/* .queryMappingValue */ .YR)(aleoClient, programId, 'isms', address, (raw) => {
1135
+ (0,_recoillink_utils__WEBPACK_IMPORTED_MODULE_3__/* .assert */ .v)(typeof raw === 'number', `Expected ISM type to be a number but got ${typeof raw}`);
1136
+ return raw;
1137
+ });
1138
+ (0,_recoillink_utils__WEBPACK_IMPORTED_MODULE_3__/* .assert */ .v)(isAleoIsmType(result), `Unknown ISM type ${result} for address: ${ismAddress}`);
1139
+ return result;
1140
+ }
1141
+ /**
1142
+ * Query the configuration for a Test ISM (Noop ISM).
1143
+ *
1144
+ * @param aleoClient - The Aleo network client
1145
+ * @param ismAddress - The full ISM address (e.g., "ism_manager.aleo/aleo1...")
1146
+ * @returns The Test ISM configuration
1147
+ */
1148
+ async function getTestIsmConfig(aleoClient, ismAddress) {
1149
+ const ismType = await getIsmType(aleoClient, ismAddress);
1150
+ (0,_recoillink_utils__WEBPACK_IMPORTED_MODULE_3__/* .assert */ .v)(ismType === _utils_types_js__WEBPACK_IMPORTED_MODULE_2__/* .AleoIsmType */ .Jt.TEST_ISM, `Expected ism at address ${ismAddress} to be of type TEST_ISM but got ${ismType}`);
1151
+ return {
1152
+ type: _utils_types_js__WEBPACK_IMPORTED_MODULE_2__/* .AleoIsmType */ .Jt.TEST_ISM,
1153
+ address: ismAddress,
1154
+ };
1155
+ }
1156
+ function formatIsmMultisigInfo(raw) {
1157
+ (0,_recoillink_utils__WEBPACK_IMPORTED_MODULE_3__/* .assert */ .v)(typeof raw === 'object' && !(0,_recoillink_utils__WEBPACK_IMPORTED_MODULE_4__/* .isNullish */ .u)(raw), `Expected multisig config to be an object but got ${typeof raw}`);
1158
+ const { validators, threshold } = raw;
1159
+ (0,_recoillink_utils__WEBPACK_IMPORTED_MODULE_3__/* .assert */ .v)(Array.isArray(validators), 'Expected validators array in multisig config');
1160
+ (0,_recoillink_utils__WEBPACK_IMPORTED_MODULE_3__/* .assert */ .v)(typeof threshold === 'number', 'Expected threshold number in multisig config');
1161
+ return {
1162
+ // The multisig ISM on Aleo can have a max
1163
+ // of 6 validators. If there are less than 6,
1164
+ // the remaining items in the array will be 0
1165
+ // addresses
1166
+ validators: validators
1167
+ .map((v) => {
1168
+ (0,_recoillink_utils__WEBPACK_IMPORTED_MODULE_3__/* .assert */ .v)(Array.isArray(v.bytes), 'Expected validator bytes to be an array');
1169
+ return (0,_recoillink_utils__WEBPACK_IMPORTED_MODULE_5__/* .ensure0x */ .Ho)(Buffer.from(v.bytes).toString('hex'));
1170
+ })
1171
+ // Remove any unset validator from the result array
1172
+ .filter((validatorAddress) => !(0,_recoillink_utils__WEBPACK_IMPORTED_MODULE_5__/* .isZeroishAddress */ .Hi)(validatorAddress)),
1173
+ threshold,
1174
+ };
1175
+ }
1176
+ /**
1177
+ * Query the configuration for a Multisig ISM (Message ID or Merkle Root).
1178
+ *
1179
+ * @param aleoClient - The Aleo network client
1180
+ * @param ismAddress - The full ISM address (e.g., "ism_manager.aleo/aleo1...")
1181
+ * @returns The Multisig ISM configuration
1182
+ */
1183
+ async function getMessageIdMultisigIsmConfig(aleoClient, ismAddress) {
1184
+ const { address, programId } = (0,_utils_helper_js__WEBPACK_IMPORTED_MODULE_1__/* .fromAleoAddress */ .kz)(ismAddress);
1185
+ const ismType = await getIsmType(aleoClient, ismAddress);
1186
+ (0,_recoillink_utils__WEBPACK_IMPORTED_MODULE_3__/* .assert */ .v)(ismType === _utils_types_js__WEBPACK_IMPORTED_MODULE_2__/* .AleoIsmType */ .Jt.MESSAGE_ID_MULTISIG, `Expected ism at address ${ismAddress} to be a multisig ISM but got ${ismType}`);
1187
+ const { threshold, validators } = await (0,_utils_base_query_js__WEBPACK_IMPORTED_MODULE_0__/* .queryMappingValue */ .YR)(aleoClient, programId, 'message_id_multisigs', address, formatIsmMultisigInfo);
1188
+ return {
1189
+ address: ismAddress,
1190
+ type: ismType,
1191
+ validators,
1192
+ threshold,
1193
+ };
1194
+ }
1195
+ function formatRoutingIsmData(raw) {
1196
+ (0,_recoillink_utils__WEBPACK_IMPORTED_MODULE_3__/* .assert */ .v)(typeof raw === 'object' && !(0,_recoillink_utils__WEBPACK_IMPORTED_MODULE_4__/* .isNullish */ .u)(raw), `Expected routing ISM data to be an object but got ${typeof raw}`);
1197
+ const { ism_owner } = raw;
1198
+ (0,_recoillink_utils__WEBPACK_IMPORTED_MODULE_3__/* .assert */ .v)(typeof ism_owner === 'string', 'Expected ism_owner to be a string in routing ISM data');
1199
+ return { owner: ism_owner };
1200
+ }
1201
+ function formatRouteLength(raw) {
1202
+ (0,_recoillink_utils__WEBPACK_IMPORTED_MODULE_3__/* .assert */ .v)(typeof raw === 'number', `Expected route length to be a number but got ${typeof raw}`);
1203
+ return raw;
1204
+ }
1205
+ function formatRouteIsmAddress(raw) {
1206
+ (0,_recoillink_utils__WEBPACK_IMPORTED_MODULE_3__/* .assert */ .v)(typeof raw === 'string', `Expected route ISM address to be a string but got ${typeof raw}`);
1207
+ return raw;
1208
+ }
1209
+ /**
1210
+ * Query the configuration for a Routing ISM.
1211
+ *
1212
+ * @param aleoClient - The Aleo network client
1213
+ * @param ismAddress - The full ISM address (e.g., "ism_manager.aleo/aleo1...")
1214
+ * @returns The Routing ISM configuration
1215
+ */
1216
+ async function getRoutingIsmConfig(aleoClient, ismAddress) {
1217
+ const { address, programId } = (0,_utils_helper_js__WEBPACK_IMPORTED_MODULE_1__/* .fromAleoAddress */ .kz)(ismAddress);
1218
+ const ismType = await getIsmType(aleoClient, ismAddress);
1219
+ (0,_recoillink_utils__WEBPACK_IMPORTED_MODULE_3__/* .assert */ .v)(ismType === _utils_types_js__WEBPACK_IMPORTED_MODULE_2__/* .AleoIsmType */ .Jt.ROUTING, `Expected ism at address ${ismAddress} to be of type ROUTING but got ${ismType}`);
1220
+ const routes = [];
1221
+ const ismData = await (0,_utils_base_query_js__WEBPACK_IMPORTED_MODULE_0__/* .queryMappingValue */ .YR)(aleoClient, programId, 'domain_routing_isms', address, formatRoutingIsmData);
1222
+ const routeLengthRes = await (0,_utils_base_query_js__WEBPACK_IMPORTED_MODULE_0__/* .queryMappingValue */ .YR)(aleoClient, programId, 'route_length', address, formatRouteLength);
1223
+ for (let i = 0; i < routeLengthRes; i++) {
1224
+ let routeKey;
1225
+ try {
1226
+ routeKey = await aleoClient.getProgramMappingPlaintext(programId, 'route_iter', `{ism:${address},index:${i}u32}`);
1227
+ }
1228
+ catch (err) {
1229
+ throw new Error(`Failed to query route_iter for ISM ${ismAddress} at index ${i}: ${err}`);
1230
+ }
1231
+ const routeIsmAddress = await (0,_utils_base_query_js__WEBPACK_IMPORTED_MODULE_0__/* .tryQueryMappingValue */ .jD)(aleoClient, programId, 'routes', routeKey.toString(), formatRouteIsmAddress);
1232
+ // This is necessary because `route_iter` maintains keys for all route entries,
1233
+ // including those from domains that have already been removed. When a domain is
1234
+ // deleted from the Routing ISM, its key remains in the map and `routes` simply returns null.
1235
+ if (!routeIsmAddress)
1236
+ continue;
1237
+ const routeKeyObj = routeKey.toObject();
1238
+ // Skip routes with invalid domain data. This could happen if the on-chain
1239
+ // structure changes. Rather than failing the entire
1240
+ // ISM read, we skip invalid entries to allow partial recovery.
1241
+ // TODO: Add proper logging when aleo-sdk has a logging framework
1242
+ if (typeof routeKeyObj.domain !== 'number' &&
1243
+ typeof routeKeyObj.domain !== 'string') {
1244
+ continue;
1245
+ }
1246
+ const domainId = Number(routeKeyObj.domain);
1247
+ if (isNaN(domainId)) {
1248
+ continue;
1249
+ }
1250
+ routes.push({
1251
+ ismAddress: `${programId}/${routeIsmAddress}`,
1252
+ domainId,
1253
+ });
1254
+ }
1255
+ return {
1256
+ type: _utils_types_js__WEBPACK_IMPORTED_MODULE_2__/* .AleoIsmType */ .Jt.ROUTING,
1257
+ address: ismAddress,
1258
+ owner: ismData.owner,
1259
+ routes: routes,
1260
+ };
1261
+ }
1262
+ //# sourceMappingURL=ism-query.js.map
1263
+ __webpack_async_result__();
1264
+ } catch(e) { __webpack_async_result__(e); } });
1265
+
1266
+ /***/ }),
1267
+
1268
+ /***/ 52789:
1269
+ /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
1270
+
1271
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
1272
+ /* harmony export */ G$: () => (/* binding */ getCreateRoutingIsmTx),
1273
+ /* harmony export */ bj: () => (/* binding */ getSetRoutingIsmRouteTx),
1274
+ /* harmony export */ dt: () => (/* binding */ getSetRoutingIsmOwnerTx),
1275
+ /* harmony export */ j: () => (/* binding */ getRemoveRoutingIsmRouteTx),
1276
+ /* harmony export */ s6: () => (/* binding */ getCreateTestIsmTx),
1277
+ /* harmony export */ yS: () => (/* binding */ getCreateMessageIdMultisigIsmTx)
1278
+ /* harmony export */ });
1279
+ /* harmony import */ var _recoillink_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(93142);
1280
+ /* harmony import */ var _utils_helper_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(15952);
1281
+
1282
+
1283
+ function getCreateTestIsmTx(ismManagerProgramId) {
1284
+ return {
1285
+ programName: ismManagerProgramId,
1286
+ functionName: 'init_noop',
1287
+ priorityFee: 0,
1288
+ privateFee: false,
1289
+ inputs: [],
1290
+ };
1291
+ }
1292
+ function getCreateMessageIdMultisigIsmTx(ismManagerProgramId, config) {
1293
+ const MAXIMUM_VALIDATORS = 6;
1294
+ if (config.validators.length > MAXIMUM_VALIDATORS) {
1295
+ throw new Error(`maximum ${MAXIMUM_VALIDATORS} validators allowed`);
1296
+ }
1297
+ const validators = (0,_utils_helper_js__WEBPACK_IMPORTED_MODULE_0__/* .fillArray */ .R2)(config.validators.map((v) => ({
1298
+ bytes: [...Buffer.from((0,_recoillink_utils__WEBPACK_IMPORTED_MODULE_1__/* .strip0x */ .LL)(v), 'hex')].map((b) => `${b}u8`),
1299
+ })), MAXIMUM_VALIDATORS, {
1300
+ bytes: Array(20).fill(`0u8`),
1301
+ });
1302
+ return {
1303
+ programName: ismManagerProgramId,
1304
+ functionName: 'init_message_id_multisig',
1305
+ priorityFee: 0,
1306
+ privateFee: false,
1307
+ inputs: [
1308
+ JSON.stringify(validators).replaceAll('"', ''),
1309
+ `${config.validators.length}u8`,
1310
+ `${config.threshold}u8`,
1311
+ ],
1312
+ };
1313
+ }
1314
+ function getCreateRoutingIsmTx(ismManagerProgramId) {
1315
+ return {
1316
+ programName: ismManagerProgramId,
1317
+ functionName: 'init_domain_routing',
1318
+ priorityFee: 0,
1319
+ privateFee: false,
1320
+ inputs: [],
1321
+ };
1322
+ }
1323
+ function getSetRoutingIsmRouteTx(ismAddress, route) {
1324
+ const { programId, address } = (0,_utils_helper_js__WEBPACK_IMPORTED_MODULE_0__/* .fromAleoAddress */ .kz)(ismAddress);
1325
+ return {
1326
+ programName: programId,
1327
+ functionName: 'set_domain',
1328
+ priorityFee: 0,
1329
+ privateFee: false,
1330
+ inputs: [
1331
+ address,
1332
+ `${route.domainId}u32`,
1333
+ (0,_utils_helper_js__WEBPACK_IMPORTED_MODULE_0__/* .fromAleoAddress */ .kz)(route.ismAddress).address,
1334
+ ],
1335
+ };
1336
+ }
1337
+ function getRemoveRoutingIsmRouteTx(ismAddress, domainId) {
1338
+ const { programId, address } = (0,_utils_helper_js__WEBPACK_IMPORTED_MODULE_0__/* .fromAleoAddress */ .kz)(ismAddress);
1339
+ return {
1340
+ programName: programId,
1341
+ functionName: 'remove_domain',
1342
+ priorityFee: 0,
1343
+ privateFee: false,
1344
+ inputs: [address, `${domainId}u32`],
1345
+ };
1346
+ }
1347
+ function getSetRoutingIsmOwnerTx(ismAddress, newOwner) {
1348
+ const { programId, address } = (0,_utils_helper_js__WEBPACK_IMPORTED_MODULE_0__/* .fromAleoAddress */ .kz)(ismAddress);
1349
+ return {
1350
+ programName: programId,
1351
+ functionName: 'transfer_routing_ism_ownership',
1352
+ priorityFee: 0,
1353
+ privateFee: false,
1354
+ inputs: [address, newOwner],
1355
+ };
1356
+ }
1357
+ //# sourceMappingURL=ism-tx.js.map
1358
+
1359
+ /***/ }),
1360
+
1361
+ /***/ 86873:
1362
+ /***/ ((__webpack_module__, __webpack_exports__, __webpack_require__) => {
1363
+
1364
+ __webpack_require__.a(__webpack_module__, async (__webpack_handle_async_dependencies__, __webpack_async_result__) => { try {
1365
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
1366
+ /* harmony export */ _: () => (/* binding */ AleoMessageIdMultisigIsmWriter),
1367
+ /* harmony export */ a: () => (/* binding */ AleoMessageIdMultisigIsmReader)
1368
+ /* harmony export */ });
1369
+ /* harmony import */ var _recoillink_provider_sdk_altvm__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(63183);
1370
+ /* harmony import */ var _recoillink_provider_sdk_artifact__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(4287);
1371
+ /* harmony import */ var _utils_base_query_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(40363);
1372
+ /* harmony import */ var _base_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(4980);
1373
+ /* harmony import */ var _ism_query_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(5575);
1374
+ /* harmony import */ var _ism_tx_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(52789);
1375
+ var __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([_utils_base_query_js__WEBPACK_IMPORTED_MODULE_2__, _ism_query_js__WEBPACK_IMPORTED_MODULE_4__]);
1376
+ ([_utils_base_query_js__WEBPACK_IMPORTED_MODULE_2__, _ism_query_js__WEBPACK_IMPORTED_MODULE_4__] = __webpack_async_dependencies__.then ? (await __webpack_async_dependencies__)() : __webpack_async_dependencies__);
1377
+
1378
+
1379
+
1380
+
1381
+
1382
+
1383
+ class AleoMessageIdMultisigIsmReader {
1384
+ aleoClient;
1385
+ constructor(aleoClient) {
1386
+ this.aleoClient = aleoClient;
1387
+ }
1388
+ async read(address) {
1389
+ const ismConfig = await (0,_ism_query_js__WEBPACK_IMPORTED_MODULE_4__/* .getMessageIdMultisigIsmConfig */ .oC)(this.aleoClient, address);
1390
+ return {
1391
+ artifactState: _recoillink_provider_sdk_artifact__WEBPACK_IMPORTED_MODULE_1__/* .ArtifactState */ .O2.DEPLOYED,
1392
+ config: {
1393
+ type: _recoillink_provider_sdk_altvm__WEBPACK_IMPORTED_MODULE_0__/* .IsmType */ .GO.MESSAGE_ID_MULTISIG,
1394
+ validators: ismConfig.validators,
1395
+ threshold: ismConfig.threshold,
1396
+ },
1397
+ deployed: {
1398
+ address: ismConfig.address,
1399
+ },
1400
+ };
1401
+ }
1402
+ }
1403
+ class AleoMessageIdMultisigIsmWriter extends AleoMessageIdMultisigIsmReader {
1404
+ signer;
1405
+ constructor(aleoClient, signer) {
1406
+ super(aleoClient);
1407
+ this.signer = signer;
1408
+ }
1409
+ async create(artifact) {
1410
+ const { config } = artifact;
1411
+ const ismManagerProgramId = await this.signer.getIsmManager();
1412
+ const transaction = (0,_ism_tx_js__WEBPACK_IMPORTED_MODULE_5__/* .getCreateMessageIdMultisigIsmTx */ .yS)(ismManagerProgramId, {
1413
+ validators: config.validators,
1414
+ threshold: config.threshold,
1415
+ });
1416
+ const expectedNonce = await (0,_utils_base_query_js__WEBPACK_IMPORTED_MODULE_2__/* .getNewContractExpectedNonce */ .Qj)(this.aleoClient, ismManagerProgramId);
1417
+ const receipt = await this.signer.sendAndConfirmTransaction(transaction);
1418
+ const ismAddress = await (0,_base_js__WEBPACK_IMPORTED_MODULE_3__/* .getNewIsmAddress */ .q)(this.aleoClient, ismManagerProgramId, expectedNonce);
1419
+ const deployedArtifact = {
1420
+ artifactState: _recoillink_provider_sdk_artifact__WEBPACK_IMPORTED_MODULE_1__/* .ArtifactState */ .O2.DEPLOYED,
1421
+ config: artifact.config,
1422
+ deployed: {
1423
+ address: ismAddress,
1424
+ },
1425
+ };
1426
+ return [deployedArtifact, [receipt]];
1427
+ }
1428
+ async update(_artifact) {
1429
+ return [];
1430
+ }
1431
+ }
1432
+ //# sourceMappingURL=multisig-ism.js.map
1433
+ __webpack_async_result__();
1434
+ } catch(e) { __webpack_async_result__(e); } });
1435
+
1436
+ /***/ }),
1437
+
1438
+ /***/ 71793:
1439
+ /***/ ((__webpack_module__, __webpack_exports__, __webpack_require__) => {
1440
+
1441
+ __webpack_require__.a(__webpack_module__, async (__webpack_handle_async_dependencies__, __webpack_async_result__) => { try {
1442
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
1443
+ /* harmony export */ I: () => (/* binding */ AleoRoutingIsmRawWriter),
1444
+ /* harmony export */ Y: () => (/* binding */ AleoRoutingIsmRawReader)
1445
+ /* harmony export */ });
1446
+ /* harmony import */ var _recoillink_provider_sdk_altvm__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(63183);
1447
+ /* harmony import */ var _recoillink_provider_sdk_artifact__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(4287);
1448
+ /* harmony import */ var _recoillink_utils__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(93142);
1449
+ /* harmony import */ var _recoillink_utils__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(73689);
1450
+ /* harmony import */ var _utils_base_query_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(40363);
1451
+ /* harmony import */ var _base_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(4980);
1452
+ /* harmony import */ var _ism_query_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(5575);
1453
+ /* harmony import */ var _ism_tx_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(52789);
1454
+ var __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([_utils_base_query_js__WEBPACK_IMPORTED_MODULE_2__, _ism_query_js__WEBPACK_IMPORTED_MODULE_4__]);
1455
+ ([_utils_base_query_js__WEBPACK_IMPORTED_MODULE_2__, _ism_query_js__WEBPACK_IMPORTED_MODULE_4__] = __webpack_async_dependencies__.then ? (await __webpack_async_dependencies__)() : __webpack_async_dependencies__);
1456
+
1457
+
1458
+
1459
+
1460
+
1461
+
1462
+
1463
+ class AleoRoutingIsmRawReader {
1464
+ aleoClient;
1465
+ constructor(aleoClient) {
1466
+ this.aleoClient = aleoClient;
1467
+ }
1468
+ async read(address) {
1469
+ const ismConfig = await (0,_ism_query_js__WEBPACK_IMPORTED_MODULE_4__/* .getRoutingIsmConfig */ .Ev)(this.aleoClient, address);
1470
+ const domains = {};
1471
+ for (const route of ismConfig.routes) {
1472
+ domains[route.domainId] = {
1473
+ deployed: {
1474
+ address: route.ismAddress,
1475
+ },
1476
+ artifactState: _recoillink_provider_sdk_artifact__WEBPACK_IMPORTED_MODULE_1__/* .ArtifactState */ .O2.UNDERIVED,
1477
+ };
1478
+ }
1479
+ return {
1480
+ artifactState: _recoillink_provider_sdk_artifact__WEBPACK_IMPORTED_MODULE_1__/* .ArtifactState */ .O2.DEPLOYED,
1481
+ config: {
1482
+ type: _recoillink_provider_sdk_altvm__WEBPACK_IMPORTED_MODULE_0__/* .IsmType */ .GO.ROUTING,
1483
+ owner: ismConfig.owner,
1484
+ domains,
1485
+ },
1486
+ deployed: {
1487
+ address: ismConfig.address,
1488
+ },
1489
+ };
1490
+ }
1491
+ }
1492
+ class AleoRoutingIsmRawWriter extends AleoRoutingIsmRawReader {
1493
+ signer;
1494
+ constructor(aleoClient, signer) {
1495
+ super(aleoClient);
1496
+ this.signer = signer;
1497
+ }
1498
+ async create(artifact) {
1499
+ const { config } = artifact;
1500
+ const ismManagerProgramId = await this.signer.getIsmManager();
1501
+ const receipts = [];
1502
+ const createTransaction = (0,_ism_tx_js__WEBPACK_IMPORTED_MODULE_5__/* .getCreateRoutingIsmTx */ .G$)(ismManagerProgramId);
1503
+ const expectedNonce = await (0,_utils_base_query_js__WEBPACK_IMPORTED_MODULE_2__/* .getNewContractExpectedNonce */ .Qj)(this.aleoClient, ismManagerProgramId);
1504
+ const createReceipt = await this.signer.sendAndConfirmTransaction(createTransaction);
1505
+ receipts.push(createReceipt);
1506
+ const ismAddress = await (0,_base_js__WEBPACK_IMPORTED_MODULE_3__/* .getNewIsmAddress */ .q)(this.aleoClient, ismManagerProgramId, expectedNonce);
1507
+ for (const [domainId, domainIsm] of Object.entries(config.domains)) {
1508
+ const setRouteTransaction = (0,_ism_tx_js__WEBPACK_IMPORTED_MODULE_5__/* .getSetRoutingIsmRouteTx */ .bj)(ismAddress, {
1509
+ domainId: parseInt(domainId),
1510
+ ismAddress: domainIsm.deployed.address,
1511
+ });
1512
+ const setRouteReceipt = await this.signer.sendAndConfirmTransaction(setRouteTransaction);
1513
+ receipts.push(setRouteReceipt);
1514
+ }
1515
+ if (!(0,_recoillink_utils__WEBPACK_IMPORTED_MODULE_6__/* .eqAddressAleo */ .qI)(config.owner, this.signer.getSignerAddress())) {
1516
+ const ownerTransferTx = (0,_ism_tx_js__WEBPACK_IMPORTED_MODULE_5__/* .getSetRoutingIsmOwnerTx */ .dt)(ismAddress, config.owner);
1517
+ const ownerReceipt = await this.signer.sendAndConfirmTransaction(ownerTransferTx);
1518
+ receipts.push(ownerReceipt);
1519
+ }
1520
+ const deployedArtifact = {
1521
+ artifactState: _recoillink_provider_sdk_artifact__WEBPACK_IMPORTED_MODULE_1__/* .ArtifactState */ .O2.DEPLOYED,
1522
+ config: artifact.config,
1523
+ deployed: {
1524
+ address: ismAddress,
1525
+ },
1526
+ };
1527
+ return [deployedArtifact, receipts];
1528
+ }
1529
+ async update(artifact) {
1530
+ const { config, deployed } = artifact;
1531
+ const currentConfig = await this.read(deployed.address);
1532
+ const transactions = [];
1533
+ for (const [domainId, expectedIsm] of Object.entries(config.domains)) {
1534
+ const domain = parseInt(domainId);
1535
+ const currentIsmAddress = currentConfig.config.domains[domain]
1536
+ ? currentConfig.config.domains[domain].deployed.address
1537
+ : undefined;
1538
+ const expectedIsmAddress = expectedIsm.deployed.address;
1539
+ if ((0,_recoillink_utils__WEBPACK_IMPORTED_MODULE_7__/* .isNullish */ .u)(currentIsmAddress) ||
1540
+ !(0,_recoillink_utils__WEBPACK_IMPORTED_MODULE_6__/* .eqAddressAleo */ .qI)(currentIsmAddress, expectedIsmAddress)) {
1541
+ const transaction = (0,_ism_tx_js__WEBPACK_IMPORTED_MODULE_5__/* .getSetRoutingIsmRouteTx */ .bj)(deployed.address, {
1542
+ domainId: domain,
1543
+ ismAddress: expectedIsmAddress,
1544
+ });
1545
+ transactions.push(transaction);
1546
+ }
1547
+ }
1548
+ for (const domainId of Object.keys(currentConfig.config.domains)) {
1549
+ const domain = parseInt(domainId);
1550
+ const desiredIsmAddress = config.domains[domain];
1551
+ if ((0,_recoillink_utils__WEBPACK_IMPORTED_MODULE_7__/* .isNullish */ .u)(desiredIsmAddress)) {
1552
+ const transaction = (0,_ism_tx_js__WEBPACK_IMPORTED_MODULE_5__/* .getRemoveRoutingIsmRouteTx */ .j)(deployed.address, domain);
1553
+ transactions.push(transaction);
1554
+ }
1555
+ }
1556
+ if (!(0,_recoillink_utils__WEBPACK_IMPORTED_MODULE_6__/* .eqAddressAleo */ .qI)(config.owner, currentConfig.config.owner)) {
1557
+ const transaction = (0,_ism_tx_js__WEBPACK_IMPORTED_MODULE_5__/* .getSetRoutingIsmOwnerTx */ .dt)(deployed.address, config.owner);
1558
+ transactions.push(transaction);
1559
+ }
1560
+ return transactions;
1561
+ }
1562
+ }
1563
+ //# sourceMappingURL=routing-ism.js.map
1564
+ __webpack_async_result__();
1565
+ } catch(e) { __webpack_async_result__(e); } });
1566
+
1567
+ /***/ }),
1568
+
1569
+ /***/ 27271:
1570
+ /***/ ((__webpack_module__, __webpack_exports__, __webpack_require__) => {
1571
+
1572
+ __webpack_require__.a(__webpack_module__, async (__webpack_handle_async_dependencies__, __webpack_async_result__) => { try {
1573
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
1574
+ /* harmony export */ G: () => (/* binding */ AleoTestIsmReader),
1575
+ /* harmony export */ S: () => (/* binding */ AleoTestIsmWriter)
1576
+ /* harmony export */ });
1577
+ /* harmony import */ var _recoillink_provider_sdk_altvm__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(63183);
1578
+ /* harmony import */ var _recoillink_provider_sdk_artifact__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(4287);
1579
+ /* harmony import */ var _utils_base_query_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(40363);
1580
+ /* harmony import */ var _base_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(4980);
1581
+ /* harmony import */ var _ism_query_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(5575);
1582
+ /* harmony import */ var _ism_tx_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(52789);
1583
+ var __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([_utils_base_query_js__WEBPACK_IMPORTED_MODULE_2__, _ism_query_js__WEBPACK_IMPORTED_MODULE_4__]);
1584
+ ([_utils_base_query_js__WEBPACK_IMPORTED_MODULE_2__, _ism_query_js__WEBPACK_IMPORTED_MODULE_4__] = __webpack_async_dependencies__.then ? (await __webpack_async_dependencies__)() : __webpack_async_dependencies__);
1585
+
1586
+
1587
+
1588
+
1589
+
1590
+
1591
+ class AleoTestIsmReader {
1592
+ aleoClient;
1593
+ constructor(aleoClient) {
1594
+ this.aleoClient = aleoClient;
1595
+ }
1596
+ async read(address) {
1597
+ const ismConfig = await (0,_ism_query_js__WEBPACK_IMPORTED_MODULE_4__/* .getTestIsmConfig */ .CA)(this.aleoClient, address);
1598
+ return {
1599
+ artifactState: _recoillink_provider_sdk_artifact__WEBPACK_IMPORTED_MODULE_1__/* .ArtifactState */ .O2.DEPLOYED,
1600
+ config: {
1601
+ type: _recoillink_provider_sdk_altvm__WEBPACK_IMPORTED_MODULE_0__/* .IsmType */ .GO.TEST_ISM,
1602
+ },
1603
+ deployed: {
1604
+ address: ismConfig.address,
1605
+ },
1606
+ };
1607
+ }
1608
+ }
1609
+ class AleoTestIsmWriter extends AleoTestIsmReader {
1610
+ signer;
1611
+ constructor(aleoClient, signer) {
1612
+ super(aleoClient);
1613
+ this.signer = signer;
1614
+ }
1615
+ async create(artifact) {
1616
+ const ismManagerProgramId = await this.signer.getIsmManager();
1617
+ const transaction = (0,_ism_tx_js__WEBPACK_IMPORTED_MODULE_5__/* .getCreateTestIsmTx */ .s6)(ismManagerProgramId);
1618
+ const expectedNonce = await (0,_utils_base_query_js__WEBPACK_IMPORTED_MODULE_2__/* .getNewContractExpectedNonce */ .Qj)(this.aleoClient, ismManagerProgramId);
1619
+ const receipt = await this.signer.sendAndConfirmTransaction(transaction);
1620
+ const ismAddress = await (0,_base_js__WEBPACK_IMPORTED_MODULE_3__/* .getNewIsmAddress */ .q)(this.aleoClient, ismManagerProgramId, expectedNonce);
1621
+ const deployedArtifact = {
1622
+ artifactState: _recoillink_provider_sdk_artifact__WEBPACK_IMPORTED_MODULE_1__/* .ArtifactState */ .O2.DEPLOYED,
1623
+ config: artifact.config,
1624
+ deployed: {
1625
+ address: ismAddress,
1626
+ },
1627
+ };
1628
+ return [deployedArtifact, [receipt]];
1629
+ }
1630
+ async update(_artifact) {
1631
+ return [];
1632
+ }
1633
+ }
1634
+ //# sourceMappingURL=test-ism.js.map
1635
+ __webpack_async_result__();
1636
+ } catch(e) { __webpack_async_result__(e); } });
1637
+
1638
+ /***/ }),
1639
+
1640
+ /***/ 19227:
1641
+ /***/ ((__webpack_module__, __webpack_exports__, __webpack_require__) => {
1642
+
1643
+ __webpack_require__.a(__webpack_module__, async (__webpack_handle_async_dependencies__, __webpack_async_result__) => { try {
1644
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
1645
+ /* harmony export */ F: () => (/* binding */ AleoMailboxArtifactManager)
1646
+ /* harmony export */ });
1647
+ /* harmony import */ var _recoillink_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(21387);
1648
+ /* harmony import */ var _mailbox_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(10990);
1649
+ var __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([_mailbox_js__WEBPACK_IMPORTED_MODULE_0__]);
1650
+ _mailbox_js__WEBPACK_IMPORTED_MODULE_0__ = (__webpack_async_dependencies__.then ? (await __webpack_async_dependencies__)() : __webpack_async_dependencies__)[0];
1651
+
1652
+
1653
+ /**
1654
+ * Aleo Mailbox Artifact Manager implementing IRawMailboxArtifactManager.
1655
+ *
1656
+ * This manager:
1657
+ * - Provides factory methods for creating mailbox readers and writers
1658
+ * - Handles mailbox deployment and configuration
1659
+ */
1660
+ class AleoMailboxArtifactManager {
1661
+ config;
1662
+ aleoClient;
1663
+ constructor(config, aleoClient) {
1664
+ this.config = config;
1665
+ this.aleoClient = aleoClient;
1666
+ }
1667
+ async readMailbox(address) {
1668
+ const reader = this.createReader('mailbox');
1669
+ return reader.read(address);
1670
+ }
1671
+ createReader(type) {
1672
+ const readers = {
1673
+ mailbox: () => new _mailbox_js__WEBPACK_IMPORTED_MODULE_0__/* .AleoMailboxReader */ .h(this.aleoClient),
1674
+ };
1675
+ (0,_recoillink_utils__WEBPACK_IMPORTED_MODULE_1__/* .assert */ .v)(readers[type], `Mailbox reader for ${type} not found`);
1676
+ return readers[type]();
1677
+ }
1678
+ createWriter(type, signer) {
1679
+ const writers = {
1680
+ mailbox: () => new _mailbox_js__WEBPACK_IMPORTED_MODULE_0__/* .AleoMailboxWriter */ .X(this.config, this.aleoClient, signer),
1681
+ };
1682
+ (0,_recoillink_utils__WEBPACK_IMPORTED_MODULE_1__/* .assert */ .v)(writers[type], `Mailbox writer for ${type} not found`);
1683
+ return writers[type]();
1684
+ }
1685
+ }
1686
+ //# sourceMappingURL=mailbox-artifact-manager.js.map
1687
+ __webpack_async_result__();
1688
+ } catch(e) { __webpack_async_result__(e); } });
1689
+
1690
+ /***/ }),
1691
+
1692
+ /***/ 4099:
1693
+ /***/ ((__webpack_module__, __webpack_exports__, __webpack_require__) => {
1694
+
1695
+ __webpack_require__.a(__webpack_module__, async (__webpack_handle_async_dependencies__, __webpack_async_result__) => { try {
1696
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
1697
+ /* harmony export */ x: () => (/* binding */ getMailboxConfig)
1698
+ /* harmony export */ });
1699
+ /* harmony import */ var _recoillink_utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(21387);
1700
+ /* harmony import */ var _utils_base_query_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(40363);
1701
+ /* harmony import */ var _utils_helper_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(15952);
1702
+ var __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([_utils_base_query_js__WEBPACK_IMPORTED_MODULE_0__]);
1703
+ _utils_base_query_js__WEBPACK_IMPORTED_MODULE_0__ = (__webpack_async_dependencies__.then ? (await __webpack_async_dependencies__)() : __webpack_async_dependencies__)[0];
1704
+
1705
+
1706
+
1707
+ /**
1708
+ * Query mailbox configuration from the chain.
1709
+ *
1710
+ * @param aleoClient - The Aleo network client
1711
+ * @param mailboxAddress - The full mailbox address (e.g., "mailbox.aleo/aleo1...")
1712
+ * @param onChainArtifactManagers - Artifact manager addresses (hookManagerAddress is ignored and derived from mailbox)
1713
+ * @returns The mailbox configuration
1714
+ */
1715
+ async function getMailboxConfig(aleoClient, mailboxAddress) {
1716
+ const { programId: mailboxProgramId } = (0,_utils_helper_js__WEBPACK_IMPORTED_MODULE_1__/* .fromAleoAddress */ .kz)(mailboxAddress);
1717
+ (0,_recoillink_utils__WEBPACK_IMPORTED_MODULE_2__/* .assert */ .v)(mailboxProgramId, `Program Id is required for reading the on chain mailbox config. Is the input address formatted as "programId/address"?`);
1718
+ const mailboxData = await (0,_utils_base_query_js__WEBPACK_IMPORTED_MODULE_0__/* .queryMappingValue */ .YR)(aleoClient, mailboxProgramId, 'mailbox', 'true', (raw) => {
1719
+ const data = raw;
1720
+ (0,_recoillink_utils__WEBPACK_IMPORTED_MODULE_2__/* .assert */ .v)(data?.mailbox_owner, `Invalid mailbox data structure for mailbox ${mailboxAddress}, expected object with mailbox_owner field`);
1721
+ return data;
1722
+ });
1723
+ const imports = await aleoClient.getProgramImportNames(mailboxProgramId);
1724
+ const ismManagerProgramId = imports.find((i) => i.includes('ism_manager'));
1725
+ (0,_recoillink_utils__WEBPACK_IMPORTED_MODULE_2__/* .assert */ .v)(ismManagerProgramId, `Expected to find ISM manager program id in mailbox program at ${mailboxAddress}`);
1726
+ return {
1727
+ address: mailboxAddress,
1728
+ owner: mailboxData.mailbox_owner,
1729
+ localDomain: mailboxData.local_domain,
1730
+ nonce: mailboxData.nonce,
1731
+ defaultIsm: (0,_utils_helper_js__WEBPACK_IMPORTED_MODULE_1__/* .formatIsmAddress */ .zg)(mailboxData.default_ism, ismManagerProgramId),
1732
+ defaultHook: (0,_utils_helper_js__WEBPACK_IMPORTED_MODULE_1__/* .formatHookAddress */ .dD)(mailboxData.default_hook, mailboxProgramId),
1733
+ requiredHook: (0,_utils_helper_js__WEBPACK_IMPORTED_MODULE_1__/* .formatHookAddress */ .dD)(mailboxData.required_hook, mailboxProgramId),
1734
+ };
1735
+ }
1736
+ //# sourceMappingURL=mailbox-query.js.map
1737
+ __webpack_async_result__();
1738
+ } catch(e) { __webpack_async_result__(e); } });
1739
+
1740
+ /***/ }),
1741
+
1742
+ /***/ 8587:
1743
+ /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
1744
+
1745
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
1746
+ /* harmony export */ Hj: () => (/* binding */ getSetMailboxRequiredHookTx),
1747
+ /* harmony export */ PX: () => (/* binding */ getCreateMailboxTx),
1748
+ /* harmony export */ dB: () => (/* binding */ getSetMailboxDefaultIsmTx),
1749
+ /* harmony export */ sk: () => (/* binding */ getSetMailboxOwnerTx),
1750
+ /* harmony export */ zs: () => (/* binding */ getSetMailboxDefaultHookTx)
1751
+ /* harmony export */ });
1752
+ /* harmony import */ var _recoillink_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(21387);
1753
+ /* harmony import */ var _utils_helper_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(15952);
1754
+
1755
+
1756
+ /**
1757
+ * Build transaction to create a mailbox
1758
+ *
1759
+ * @param mailboxProgramId - The mailbox program ID
1760
+ * @param domainId - The local domain ID
1761
+ * @returns The transaction object
1762
+ */
1763
+ function getCreateMailboxTx(mailboxProgramId, domainId) {
1764
+ return {
1765
+ programName: mailboxProgramId,
1766
+ functionName: 'init',
1767
+ priorityFee: 0,
1768
+ privateFee: false,
1769
+ inputs: [`${domainId}u32`],
1770
+ };
1771
+ }
1772
+ /**
1773
+ * Build transaction to set mailbox owner
1774
+ *
1775
+ * @param mailboxAddress - The full mailbox address (e.g., "mailbox.aleo/aleo1...")
1776
+ * @param newOwner - The new owner address
1777
+ * @returns The transaction object
1778
+ */
1779
+ function getSetMailboxOwnerTx(mailboxAddress, newOwner) {
1780
+ const { programId } = (0,_utils_helper_js__WEBPACK_IMPORTED_MODULE_0__/* .fromAleoAddress */ .kz)(mailboxAddress);
1781
+ (0,_recoillink_utils__WEBPACK_IMPORTED_MODULE_1__/* .assert */ .v)(programId, `Expected programId in mailbox address: ${mailboxAddress}`);
1782
+ return {
1783
+ programName: programId,
1784
+ functionName: 'set_owner',
1785
+ priorityFee: 0,
1786
+ privateFee: false,
1787
+ inputs: [newOwner],
1788
+ };
1789
+ }
1790
+ /**
1791
+ * Build transaction to set mailbox default ISM
1792
+ *
1793
+ * @param mailboxAddress - The full mailbox address (e.g., "mailbox.aleo/aleo1...")
1794
+ * @param ismAddress - The full ISM address
1795
+ * @returns The transaction object
1796
+ */
1797
+ function getSetMailboxDefaultIsmTx(mailboxAddress, ismAddress) {
1798
+ const { programId } = (0,_utils_helper_js__WEBPACK_IMPORTED_MODULE_0__/* .fromAleoAddress */ .kz)(mailboxAddress);
1799
+ (0,_recoillink_utils__WEBPACK_IMPORTED_MODULE_1__/* .assert */ .v)(programId, `Expected programId in mailbox address: ${mailboxAddress}`);
1800
+ const { address } = (0,_utils_helper_js__WEBPACK_IMPORTED_MODULE_0__/* .fromAleoAddress */ .kz)(ismAddress);
1801
+ return {
1802
+ programName: programId,
1803
+ functionName: 'set_default_ism',
1804
+ priorityFee: 0,
1805
+ privateFee: false,
1806
+ inputs: [address],
1807
+ };
1808
+ }
1809
+ /**
1810
+ * Build transaction to set mailbox default hook
1811
+ *
1812
+ * @param mailboxAddress - The full mailbox address (e.g., "mailbox.aleo/aleo1...")
1813
+ * @param hookAddress - The full hook address
1814
+ * @returns The transaction object
1815
+ */
1816
+ function getSetMailboxDefaultHookTx(mailboxAddress, hookAddress) {
1817
+ const { programId } = (0,_utils_helper_js__WEBPACK_IMPORTED_MODULE_0__/* .fromAleoAddress */ .kz)(mailboxAddress);
1818
+ (0,_recoillink_utils__WEBPACK_IMPORTED_MODULE_1__/* .assert */ .v)(programId, `Expected programId in mailbox address: ${mailboxAddress}`);
1819
+ const { address } = (0,_utils_helper_js__WEBPACK_IMPORTED_MODULE_0__/* .fromAleoAddress */ .kz)(hookAddress);
1820
+ return {
1821
+ programName: programId,
1822
+ functionName: 'set_default_hook',
1823
+ priorityFee: 0,
1824
+ privateFee: false,
1825
+ inputs: [address],
1826
+ };
1827
+ }
1828
+ /**
1829
+ * Build transaction to set mailbox required hook
1830
+ *
1831
+ * @param mailboxAddress - The full mailbox address (e.g., "mailbox.aleo/aleo1...")
1832
+ * @param hookAddress - The full hook address
1833
+ * @returns The transaction object
1834
+ */
1835
+ function getSetMailboxRequiredHookTx(mailboxAddress, hookAddress) {
1836
+ const { programId } = (0,_utils_helper_js__WEBPACK_IMPORTED_MODULE_0__/* .fromAleoAddress */ .kz)(mailboxAddress);
1837
+ (0,_recoillink_utils__WEBPACK_IMPORTED_MODULE_1__/* .assert */ .v)(programId, `Expected programId in mailbox address: ${mailboxAddress}`);
1838
+ const { address } = (0,_utils_helper_js__WEBPACK_IMPORTED_MODULE_0__/* .fromAleoAddress */ .kz)(hookAddress);
1839
+ return {
1840
+ programName: programId,
1841
+ functionName: 'set_required_hook',
1842
+ priorityFee: 0,
1843
+ privateFee: false,
1844
+ inputs: [address],
1845
+ };
1846
+ }
1847
+ //# sourceMappingURL=mailbox-tx.js.map
1848
+
1849
+ /***/ }),
1850
+
1851
+ /***/ 10990:
1852
+ /***/ ((__webpack_module__, __webpack_exports__, __webpack_require__) => {
1853
+
1854
+ __webpack_require__.a(__webpack_module__, async (__webpack_handle_async_dependencies__, __webpack_async_result__) => { try {
1855
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
1856
+ /* harmony export */ X: () => (/* binding */ AleoMailboxWriter),
1857
+ /* harmony export */ h: () => (/* binding */ AleoMailboxReader)
1858
+ /* harmony export */ });
1859
+ /* harmony import */ var _recoillink_provider_sdk_artifact__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4287);
1860
+ /* harmony import */ var _recoillink_utils__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(21387);
1861
+ /* harmony import */ var _recoillink_utils__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(93142);
1862
+ /* harmony import */ var _utils_helper_crypto_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(44996);
1863
+ /* harmony import */ var _utils_helper_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(15952);
1864
+ /* harmony import */ var _mailbox_query_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(4099);
1865
+ /* harmony import */ var _mailbox_tx_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(8587);
1866
+ var __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([_utils_helper_crypto_js__WEBPACK_IMPORTED_MODULE_1__, _mailbox_query_js__WEBPACK_IMPORTED_MODULE_3__]);
1867
+ ([_utils_helper_crypto_js__WEBPACK_IMPORTED_MODULE_1__, _mailbox_query_js__WEBPACK_IMPORTED_MODULE_3__] = __webpack_async_dependencies__.then ? (await __webpack_async_dependencies__)() : __webpack_async_dependencies__);
1868
+
1869
+
1870
+
1871
+
1872
+
1873
+
1874
+ /**
1875
+ * Reader for Aleo Mailbox.
1876
+ * Reads deployed mailbox configuration from the chain.
1877
+ */
1878
+ class AleoMailboxReader {
1879
+ aleoClient;
1880
+ constructor(aleoClient) {
1881
+ this.aleoClient = aleoClient;
1882
+ }
1883
+ async read(address) {
1884
+ const mailboxConfig = await (0,_mailbox_query_js__WEBPACK_IMPORTED_MODULE_3__/* .getMailboxConfig */ .x)(this.aleoClient, address);
1885
+ return {
1886
+ artifactState: _recoillink_provider_sdk_artifact__WEBPACK_IMPORTED_MODULE_0__/* .ArtifactState */ .O2.DEPLOYED,
1887
+ config: {
1888
+ owner: mailboxConfig.owner,
1889
+ defaultIsm: {
1890
+ artifactState: _recoillink_provider_sdk_artifact__WEBPACK_IMPORTED_MODULE_0__/* .ArtifactState */ .O2.UNDERIVED,
1891
+ deployed: {
1892
+ address: mailboxConfig.defaultIsm,
1893
+ },
1894
+ },
1895
+ defaultHook: {
1896
+ artifactState: _recoillink_provider_sdk_artifact__WEBPACK_IMPORTED_MODULE_0__/* .ArtifactState */ .O2.UNDERIVED,
1897
+ deployed: {
1898
+ address: mailboxConfig.defaultHook,
1899
+ },
1900
+ },
1901
+ requiredHook: {
1902
+ artifactState: _recoillink_provider_sdk_artifact__WEBPACK_IMPORTED_MODULE_0__/* .ArtifactState */ .O2.UNDERIVED,
1903
+ deployed: {
1904
+ address: mailboxConfig.requiredHook,
1905
+ },
1906
+ },
1907
+ },
1908
+ deployed: {
1909
+ address: mailboxConfig.address,
1910
+ domainId: mailboxConfig.localDomain,
1911
+ },
1912
+ };
1913
+ }
1914
+ }
1915
+ /**
1916
+ * Writer for Aleo Mailbox.
1917
+ * Handles deployment and updates.
1918
+ */
1919
+ class AleoMailboxWriter extends AleoMailboxReader {
1920
+ config;
1921
+ signer;
1922
+ constructor(config, aleoClient, signer) {
1923
+ super(aleoClient);
1924
+ this.config = config;
1925
+ this.signer = signer;
1926
+ }
1927
+ async create(artifact) {
1928
+ const { config } = artifact;
1929
+ const allReceipts = [];
1930
+ // Deploy mailbox programs (mailbox, dispatch_proxy, ism_manager, hook_manager)
1931
+ const prefix = (0,_utils_helper_js__WEBPACK_IMPORTED_MODULE_2__/* .getNetworkPrefix */ .nA)(this.config.aleoNetworkId);
1932
+ const suffix = await (0,_utils_helper_js__WEBPACK_IMPORTED_MODULE_2__/* .getUnusedSuffix */ .ED)(this.aleoClient, prefix, 'dispatch_proxy', _utils_helper_js__WEBPACK_IMPORTED_MODULE_2__/* .SUFFIX_LENGTH_LONG */ .SO);
1933
+ const programs = await this.signer.deployProgram('dispatch_proxy', suffix);
1934
+ const mailboxProgramId = programs['mailbox'];
1935
+ (0,_recoillink_utils__WEBPACK_IMPORTED_MODULE_5__/* .assert */ .v)(mailboxProgramId, 'mailbox program not deployed');
1936
+ const dispatchProxyProgramId = programs['dispatch_proxy'];
1937
+ (0,_recoillink_utils__WEBPACK_IMPORTED_MODULE_5__/* .assert */ .v)(dispatchProxyProgramId, 'dispatch_proxy program not deployed');
1938
+ // 1. Create mailbox
1939
+ const createTx = (0,_mailbox_tx_js__WEBPACK_IMPORTED_MODULE_4__/* .getCreateMailboxTx */ .PX)(mailboxProgramId, this.config.domainId);
1940
+ const createReceipt = await this.signer.sendAndConfirmTransaction(createTx);
1941
+ allReceipts.push(createReceipt);
1942
+ // 2. Set dispatch proxy
1943
+ const setDispatchProxyTx = {
1944
+ programName: mailboxProgramId,
1945
+ functionName: 'set_dispatch_proxy',
1946
+ priorityFee: 0,
1947
+ privateFee: false,
1948
+ inputs: [dispatchProxyProgramId],
1949
+ };
1950
+ const dispatchProxyReceipt = await this.signer.sendAndConfirmTransaction(setDispatchProxyTx);
1951
+ allReceipts.push(dispatchProxyReceipt);
1952
+ const mailboxAddress = (0,_utils_helper_crypto_js__WEBPACK_IMPORTED_MODULE_1__/* .toAleoAddress */ .j2)(mailboxProgramId);
1953
+ // Extract addresses from artifacts
1954
+ const defaultIsmAddress = config.defaultIsm.deployed.address;
1955
+ const defaultHookAddress = config.defaultHook.deployed.address;
1956
+ const requiredHookAddress = config.requiredHook.deployed.address;
1957
+ // 3. Set default ISM (if provided and not null address)
1958
+ if (!(0,_recoillink_utils__WEBPACK_IMPORTED_MODULE_6__/* .eqOptionalAddress */ .le)(defaultIsmAddress, _utils_helper_js__WEBPACK_IMPORTED_MODULE_2__/* .ALEO_NULL_ADDRESS */ .B$, _recoillink_utils__WEBPACK_IMPORTED_MODULE_6__/* .eqAddressAleo */ .qI)) {
1959
+ const setIsmTx = (0,_mailbox_tx_js__WEBPACK_IMPORTED_MODULE_4__/* .getSetMailboxDefaultIsmTx */ .dB)(mailboxAddress, defaultIsmAddress);
1960
+ const ismReceipt = await this.signer.sendAndConfirmTransaction(setIsmTx);
1961
+ allReceipts.push(ismReceipt);
1962
+ }
1963
+ // 4. Set default hook (if provided and not null address)
1964
+ if (!(0,_recoillink_utils__WEBPACK_IMPORTED_MODULE_6__/* .eqOptionalAddress */ .le)(defaultHookAddress, _utils_helper_js__WEBPACK_IMPORTED_MODULE_2__/* .ALEO_NULL_ADDRESS */ .B$, _recoillink_utils__WEBPACK_IMPORTED_MODULE_6__/* .eqAddressAleo */ .qI)) {
1965
+ const setDefaultHookTx = (0,_mailbox_tx_js__WEBPACK_IMPORTED_MODULE_4__/* .getSetMailboxDefaultHookTx */ .zs)(mailboxAddress, defaultHookAddress);
1966
+ const hookReceipt = await this.signer.sendAndConfirmTransaction(setDefaultHookTx);
1967
+ allReceipts.push(hookReceipt);
1968
+ }
1969
+ // 5. Set required hook (if provided and not null address)
1970
+ if (!(0,_recoillink_utils__WEBPACK_IMPORTED_MODULE_6__/* .eqOptionalAddress */ .le)(requiredHookAddress, _utils_helper_js__WEBPACK_IMPORTED_MODULE_2__/* .ALEO_NULL_ADDRESS */ .B$, _recoillink_utils__WEBPACK_IMPORTED_MODULE_6__/* .eqAddressAleo */ .qI)) {
1971
+ const setRequiredHookTx = (0,_mailbox_tx_js__WEBPACK_IMPORTED_MODULE_4__/* .getSetMailboxRequiredHookTx */ .Hj)(mailboxAddress, requiredHookAddress);
1972
+ const requiredHookReceipt = await this.signer.sendAndConfirmTransaction(setRequiredHookTx);
1973
+ allReceipts.push(requiredHookReceipt);
1974
+ }
1975
+ // Note: Ownership is NOT transferred during creation to allow for
1976
+ // subsequent updates by the deployer. Use update() to transfer ownership
1977
+ // when all configuration is complete.
1978
+ const deployedArtifact = {
1979
+ artifactState: _recoillink_provider_sdk_artifact__WEBPACK_IMPORTED_MODULE_0__/* .ArtifactState */ .O2.DEPLOYED,
1980
+ config: { ...config, owner: this.signer.getSignerAddress() },
1981
+ deployed: {
1982
+ address: mailboxAddress,
1983
+ domainId: this.config.domainId,
1984
+ },
1985
+ };
1986
+ return [deployedArtifact, allReceipts];
1987
+ }
1988
+ async update(artifact) {
1989
+ const { config, deployed } = artifact;
1990
+ const updateTxs = [];
1991
+ // Read current state
1992
+ const currentState = await this.read(deployed.address);
1993
+ const currentConfig = currentState.config;
1994
+ // Extract addresses from artifacts
1995
+ const expectedDefaultIsmAddress = config.defaultIsm.deployed.address;
1996
+ const expectedDefaultHookAddress = config.defaultHook.deployed.address;
1997
+ const expectedRequiredHookAddress = config.requiredHook.deployed.address;
1998
+ const currentDefaultIsmAddress = currentConfig.defaultIsm.deployed.address;
1999
+ const currentDefaultHookAddress = currentConfig.defaultHook.deployed.address;
2000
+ const currentRequiredHookAddress = currentConfig.requiredHook.deployed.address;
2001
+ // 1. Update default ISM if changed
2002
+ if (!(0,_recoillink_utils__WEBPACK_IMPORTED_MODULE_6__/* .eqOptionalAddress */ .le)(currentDefaultIsmAddress, expectedDefaultIsmAddress, _recoillink_utils__WEBPACK_IMPORTED_MODULE_6__/* .eqAddressAleo */ .qI)) {
2003
+ updateTxs.push({
2004
+ annotation: `Update mailbox default ISM to ${expectedDefaultIsmAddress}`,
2005
+ ...(0,_mailbox_tx_js__WEBPACK_IMPORTED_MODULE_4__/* .getSetMailboxDefaultIsmTx */ .dB)(deployed.address, expectedDefaultIsmAddress),
2006
+ });
2007
+ }
2008
+ // 2. Update default hook if changed
2009
+ if (!(0,_recoillink_utils__WEBPACK_IMPORTED_MODULE_6__/* .eqOptionalAddress */ .le)(currentDefaultHookAddress, expectedDefaultHookAddress, _recoillink_utils__WEBPACK_IMPORTED_MODULE_6__/* .eqAddressAleo */ .qI)) {
2010
+ updateTxs.push({
2011
+ annotation: `Update mailbox default hook to ${expectedDefaultHookAddress}`,
2012
+ ...(0,_mailbox_tx_js__WEBPACK_IMPORTED_MODULE_4__/* .getSetMailboxDefaultHookTx */ .zs)(deployed.address, expectedDefaultHookAddress),
2013
+ });
2014
+ }
2015
+ // 3. Update required hook if changed
2016
+ if (!(0,_recoillink_utils__WEBPACK_IMPORTED_MODULE_6__/* .eqOptionalAddress */ .le)(currentRequiredHookAddress, expectedRequiredHookAddress, _recoillink_utils__WEBPACK_IMPORTED_MODULE_6__/* .eqAddressAleo */ .qI)) {
2017
+ updateTxs.push({
2018
+ annotation: `Update mailbox required hook to ${expectedRequiredHookAddress}`,
2019
+ ...(0,_mailbox_tx_js__WEBPACK_IMPORTED_MODULE_4__/* .getSetMailboxRequiredHookTx */ .Hj)(deployed.address, expectedRequiredHookAddress),
2020
+ });
2021
+ }
2022
+ // 4. Update owner if changed (do this last to avoid permission issues)
2023
+ if (!(0,_recoillink_utils__WEBPACK_IMPORTED_MODULE_6__/* .eqOptionalAddress */ .le)(currentConfig.owner, config.owner, _recoillink_utils__WEBPACK_IMPORTED_MODULE_6__/* .eqAddressAleo */ .qI)) {
2024
+ updateTxs.push({
2025
+ annotation: `Transfer mailbox ownership to ${config.owner}`,
2026
+ ...(0,_mailbox_tx_js__WEBPACK_IMPORTED_MODULE_4__/* .getSetMailboxOwnerTx */ .sk)(deployed.address, config.owner),
2027
+ });
2028
+ }
2029
+ return updateTxs;
2030
+ }
2031
+ }
2032
+ //# sourceMappingURL=mailbox.js.map
2033
+ __webpack_async_result__();
2034
+ } catch(e) { __webpack_async_result__(e); } });
2035
+
2036
+ /***/ }),
2037
+
2038
+ /***/ 40363:
2039
+ /***/ ((__webpack_module__, __webpack_exports__, __webpack_require__) => {
2040
+
2041
+ __webpack_require__.a(__webpack_module__, async (__webpack_handle_async_dependencies__, __webpack_async_result__) => { try {
2042
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
2043
+ /* harmony export */ Qj: () => (/* binding */ getNewContractExpectedNonce),
2044
+ /* harmony export */ YR: () => (/* binding */ queryMappingValue),
2045
+ /* harmony export */ jD: () => (/* binding */ tryQueryMappingValue)
2046
+ /* harmony export */ });
2047
+ /* harmony import */ var _provablehq_sdk__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(83684);
2048
+ /* harmony import */ var _recoillink_utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(14918);
2049
+ /* harmony import */ var _recoillink_utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(73689);
2050
+ /* harmony import */ var _recoillink_utils__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(21387);
2051
+ /* harmony import */ var _helper_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(15952);
2052
+ var __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([_provablehq_sdk__WEBPACK_IMPORTED_MODULE_0__]);
2053
+ _provablehq_sdk__WEBPACK_IMPORTED_MODULE_0__ = (__webpack_async_dependencies__.then ? (await __webpack_async_dependencies__)() : __webpack_async_dependencies__)[0];
2054
+
2055
+
2056
+
2057
+ /**
2058
+ * Retrieves the expected nonce for the next artifact to be created by an artifact manager.
2059
+ *
2060
+ * This function queries an artifact manager's `nonce` mapping to get the current count of
2061
+ * created artifacts. This nonce value must be retrieved BEFORE submitting the artifact creation
2062
+ * transaction, as it will be used to look up the newly created artifact's address from the
2063
+ * manager's address registry after the transaction is confirmed.
2064
+ *
2065
+ * The typical usage pattern for any artifact manager (ISM manager, hook manager, etc.) is:
2066
+ * 1. Call this function to get the expected nonce
2067
+ * 2. Submit the artifact creation transaction
2068
+ * 3. Use the nonce with `getNewIsmAddress()` or similar to retrieve the new artifact's address
2069
+ *
2070
+ * @param aleoClient - The Aleo network client for querying contract state
2071
+ * @param ismManagerProgramId - The program ID of the artifact manager contract
2072
+ * @returns The nonce as an Aleo u32 string (e.g., "0u32", "1u32"), defaulting to "0u32" if no artifacts have been created yet
2073
+ *
2074
+ * @example
2075
+ * ```typescript
2076
+ * // Works with any artifact manager (ISM, hook, etc.)
2077
+ * const expectedNonce = await getNewContractExpectedNonce(client, managerProgramId);
2078
+ * const receipt = await signer.sendAndConfirmTransaction(createArtifactTx);
2079
+ * const artifactAddress = await getNewArtifactAddress(client, managerProgramId, expectedNonce);
2080
+ * ```
2081
+ */
2082
+ async function getNewContractExpectedNonce(aleoClient, ismManagerProgramId) {
2083
+ let nonce = await (0,_recoillink_utils__WEBPACK_IMPORTED_MODULE_2__/* .retryAsync */ .tH)(() => aleoClient.getProgramMappingValue(ismManagerProgramId, 'nonce', 'true'), _helper_js__WEBPACK_IMPORTED_MODULE_1__/* .RETRY_ATTEMPTS */ .Km, _helper_js__WEBPACK_IMPORTED_MODULE_1__/* .RETRY_DELAY_MS */ .k);
2084
+ if (nonce === null) {
2085
+ nonce = '0u32';
2086
+ }
2087
+ return nonce;
2088
+ }
2089
+ /**
2090
+ * Helper function to query a mapping value from an Aleo program.
2091
+ *
2092
+ * @param aleoClient - The Aleo network client
2093
+ * @param programId - The program ID to query
2094
+ * @param mappingName - The name of the mapping
2095
+ * @param key - The key to look up in the mapping
2096
+ * @param formatter - Parsing function to transform the raw result into type T
2097
+ * @returns The parsed mapping value, or undefined if not found
2098
+ */
2099
+ async function tryQueryMappingValue(aleoClient, programId, mappingName, key, formatter) {
2100
+ try {
2101
+ const result = await aleoClient.getProgramMappingValue(programId, mappingName, key);
2102
+ return !(0,_recoillink_utils__WEBPACK_IMPORTED_MODULE_3__/* .isNullish */ .u)(result)
2103
+ ? formatter(_provablehq_sdk__WEBPACK_IMPORTED_MODULE_0__.Plaintext.fromString(result).toObject())
2104
+ : undefined;
2105
+ }
2106
+ catch (err) {
2107
+ throw new Error(`Failed to query mapping value for program ${programId}/${mappingName}/${key}: ${err}`);
2108
+ }
2109
+ }
2110
+ /**
2111
+ * Helper function to query a mapping value from an Aleo program.
2112
+ *
2113
+ * @param aleoClient - The Aleo network client
2114
+ * @param programId - The program ID to query
2115
+ * @param mappingName - The name of the mapping
2116
+ * @param key - The key to look up in the mapping
2117
+ * @param formatter - Parsing function to transform the raw result into type T
2118
+ * @returns The parsed mapping value
2119
+ */
2120
+ async function queryMappingValue(aleoClient, programId, mappingName, key, formatter) {
2121
+ const result = await tryQueryMappingValue(aleoClient, programId, mappingName, key, formatter);
2122
+ (0,_recoillink_utils__WEBPACK_IMPORTED_MODULE_4__/* .assert */ .v)(!(0,_recoillink_utils__WEBPACK_IMPORTED_MODULE_3__/* .isNullish */ .u)(result), `Value not found in mapping ${programId}/${mappingName}/${key}`);
2123
+ return result;
2124
+ }
2125
+ //# sourceMappingURL=base-query.js.map
2126
+ __webpack_async_result__();
2127
+ } catch(e) { __webpack_async_result__(e); } });
2128
+
2129
+ /***/ }),
2130
+
2131
+ /***/ 83345:
2132
+ /***/ ((__webpack_module__, __webpack_exports__, __webpack_require__) => {
2133
+
2134
+ __webpack_require__.a(__webpack_module__, async (__webpack_handle_async_dependencies__, __webpack_async_result__) => { try {
2135
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
2136
+ /* harmony export */ gi: () => (/* binding */ getFileOverrideProgramId),
2137
+ /* harmony export */ wR: () => (/* binding */ loadProgramsInDeployOrder)
2138
+ /* harmony export */ });
2139
+ /* unused harmony export PROGRAM_FILE_ENV */
2140
+ /* harmony import */ var fs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(79896);
2141
+ /* harmony import */ var _provablehq_sdk_mainnet_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(37645);
2142
+ /* harmony import */ var _recoillink_utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(21387);
2143
+ /* harmony import */ var _artifacts_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(29026);
2144
+ var __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([_provablehq_sdk_mainnet_js__WEBPACK_IMPORTED_MODULE_1__]);
2145
+ _provablehq_sdk_mainnet_js__WEBPACK_IMPORTED_MODULE_1__ = (__webpack_async_dependencies__.then ? (await __webpack_async_dependencies__)() : __webpack_async_dependencies__)[0];
2146
+
2147
+
2148
+
2149
+
2150
+ const upgradeAuthority = process.env['ALEO_UPGRADE_AUTHORITY'] || '';
2151
+ const skipSuffixes = JSON.parse(process.env['ALEO_SKIP_SUFFIXES'] || 'false');
2152
+ const customIsmSuffix = process.env['ALEO_ISM_MANAGER_SUFFIX'];
2153
+ // Env vars that point to pre-built .aleo files to deploy verbatim
2154
+ const PROGRAM_FILE_ENV = {
2155
+ credits: 'ALEO_CREDITS',
2156
+ dispatch_proxy: 'ALEO_DISPATCH_PROXY',
2157
+ hook_manager: 'ALEO_HOOK_MANAGER',
2158
+ hyp_collateral: 'ALEO_HYP_COLLATERAL',
2159
+ hyp_native: 'ALEO_HYP_NATIVE',
2160
+ hyp_synthetic: 'ALEO_HYP_SYNTHETIC',
2161
+ ism_manager: 'ALEO_ISM_MANAGER',
2162
+ mailbox: 'ALEO_MAILBOX',
2163
+ token_registry: 'ALEO_TOKEN_REGISTRY',
2164
+ validator_announce: 'ALEO_VALIDATOR_ANNOUNCE',
2165
+ };
2166
+ function readFileOverride(programName) {
2167
+ const envVar = PROGRAM_FILE_ENV[programName];
2168
+ if (!envVar)
2169
+ return undefined;
2170
+ const filePath = process.env[envVar];
2171
+ if (!filePath)
2172
+ return undefined;
2173
+ const content = (0,fs__WEBPACK_IMPORTED_MODULE_0__.readFileSync)(filePath, 'utf8');
2174
+ const match = content.match(/^program ([a-z0-9_]+\.aleo);/m);
2175
+ (0,_recoillink_utils__WEBPACK_IMPORTED_MODULE_3__/* .assert */ .v)(match, `Could not find program declaration in override file ${filePath}`);
2176
+ const [, id] = match;
2177
+ (0,_recoillink_utils__WEBPACK_IMPORTED_MODULE_3__/* .assert */ .v)(id, `Program declaration has no id in override file ${filePath}`);
2178
+ try {
2179
+ _provablehq_sdk_mainnet_js__WEBPACK_IMPORTED_MODULE_1__.Program.fromString(content);
2180
+ }
2181
+ catch (e) {
2182
+ const msg = e instanceof Error ? e.message : String(e);
2183
+ throw new Error(`Invalid Aleo program in override file ${filePath} (${id}): ${msg}`);
2184
+ }
2185
+ return { id, program: content };
2186
+ }
2187
+ function getFileOverrideProgramId(programName) {
2188
+ return readFileOverride(programName)?.id;
2189
+ }
2190
+ function getCustomWarpSuffixFromEnv() {
2191
+ return process.env['ALEO_WARP_SUFFIX'];
2192
+ }
2193
+ function loadProgramsInDeployOrder(prefix, programName, coreSuffix, warpSuffix) {
2194
+ // If a file override is set, deploy that file verbatim — no substitutions, no deps
2195
+ const override = readFileOverride(programName);
2196
+ if (override) {
2197
+ return [{ id: override.id, name: programName, program: override.program }];
2198
+ }
2199
+ const visited = new Set();
2200
+ let programs = [];
2201
+ function visit(p) {
2202
+ if (visited.has(p))
2203
+ return;
2204
+ visited.add(p);
2205
+ const code = _artifacts_js__WEBPACK_IMPORTED_MODULE_2__/* .programRegistry */ .aE[p];
2206
+ if (!code)
2207
+ throw new Error(`Program ${p} not found`);
2208
+ const program = _provablehq_sdk_mainnet_js__WEBPACK_IMPORTED_MODULE_1__.Program.fromString(code);
2209
+ program
2210
+ .getImports()
2211
+ .map((dep) => dep.replace('.aleo', ''))
2212
+ .forEach((dep) => visit(dep));
2213
+ programs.push(program);
2214
+ }
2215
+ visit(programName);
2216
+ programs = programs.map((p) => {
2217
+ let output = p.toString();
2218
+ for (const r of Object.keys(_artifacts_js__WEBPACK_IMPORTED_MODULE_2__/* .programRegistry */ .aE)) {
2219
+ if (r === 'credits' || r === 'token_registry') {
2220
+ continue;
2221
+ }
2222
+ output = output.replaceAll(`${r}.aleo`, `${prefix}_${r.replaceAll('hyp_', '')}.aleo`);
2223
+ }
2224
+ return _provablehq_sdk_mainnet_js__WEBPACK_IMPORTED_MODULE_1__.Program.fromString(output);
2225
+ });
2226
+ if (!skipSuffixes) {
2227
+ programs = programs.map((p) => _provablehq_sdk_mainnet_js__WEBPACK_IMPORTED_MODULE_1__.Program.fromString(p
2228
+ .toString()
2229
+ .replaceAll(/(mailbox|hook_manager|dispatch_proxy|validator_announce).aleo/g, (_, p1) => (coreSuffix ? `${p1}_${coreSuffix}.aleo` : `${p1}.aleo`))
2230
+ .replaceAll(/(hyp_native|hyp_collateral|hyp_synthetic).aleo/g, (_, p1) => {
2231
+ if (p1 === 'hyp_native') {
2232
+ return `hyp_warp_token_credits.aleo`;
2233
+ }
2234
+ const effectiveSuffix = getCustomWarpSuffixFromEnv() || warpSuffix || coreSuffix;
2235
+ return `hyp_warp_token_${effectiveSuffix}.aleo`;
2236
+ })));
2237
+ if (customIsmSuffix) {
2238
+ programs = programs.map((p) => _provablehq_sdk_mainnet_js__WEBPACK_IMPORTED_MODULE_1__.Program.fromString(p
2239
+ .toString()
2240
+ .replaceAll('ism_manager.aleo', `ism_manager_${customIsmSuffix}.aleo`)));
2241
+ }
2242
+ }
2243
+ if (upgradeAuthority) {
2244
+ if (new RegExp(/^(aleo1[a-z0-9]{58})$/).test(upgradeAuthority)) {
2245
+ programs = programs.map((p) => _provablehq_sdk_mainnet_js__WEBPACK_IMPORTED_MODULE_1__.Program.fromString(p.toString().replaceAll(`constructor:
2246
+ assert.eq edition 0u16;`, `constructor:
2247
+ assert.eq program_owner ${upgradeAuthority};`)));
2248
+ }
2249
+ else if (new RegExp(/^[a-z0-9_]+\.aleo$/).test(upgradeAuthority)) {
2250
+ programs = programs.map((p) => _provablehq_sdk_mainnet_js__WEBPACK_IMPORTED_MODULE_1__.Program.fromString(`import ${upgradeAuthority};\n` +
2251
+ p.toString().replaceAll(`constructor:
2252
+ assert.eq edition 0u16;`, `struct ChecksumEdition:
2253
+ checksum as [u8; 32u32];
2254
+ edition as u16;
2255
+
2256
+ struct WalletEcdsaSigner:
2257
+ wallet_id as address;
2258
+ ecdsa_signer as [u8; 20u32];
2259
+
2260
+ struct WalletSigningOpId:
2261
+ wallet_id as address;
2262
+ signing_op_id as field;
2263
+
2264
+ struct AdminOp:
2265
+ op as u8;
2266
+ threshold as u8;
2267
+ aleo_signer as address;
2268
+ ecdsa_signer as [u8; 20u32];
2269
+
2270
+ constructor:
2271
+ gt edition 0u16 into r0;
2272
+ branch.eq r0 false to end_then_0_2;
2273
+ cast checksum edition into r1 as ChecksumEdition;
2274
+ hash.bhp256 r1 into r2 as field;
2275
+ cast ${p.id()} r2 into r3 as WalletSigningOpId;
2276
+ hash.bhp256 r3 into r4 as field;
2277
+ contains ${upgradeAuthority}/completed_signing_ops[r4] into r5;
2278
+ assert.eq r5 true;
2279
+ branch.eq true true to end_otherwise_0_3;
2280
+ position end_then_0_2;
2281
+ position end_otherwise_0_3;`)));
2282
+ }
2283
+ else {
2284
+ throw new Error(`upgrade authority must be an aleo account address or the program id of a multisig program`);
2285
+ }
2286
+ }
2287
+ return programs.map((p) => ({
2288
+ id: p.id(),
2289
+ name: Object.keys(_artifacts_js__WEBPACK_IMPORTED_MODULE_2__/* .programRegistry */ .aE).find((r) => {
2290
+ if (r === 'hyp_native') {
2291
+ return p.id() === `${prefix}_warp_token_credits.aleo`;
2292
+ }
2293
+ if ((r === 'hyp_collateral' || r === 'hyp_synthetic') &&
2294
+ r === programName &&
2295
+ p.id().startsWith(`${prefix}_warp_token_`) &&
2296
+ p.id() !== `${prefix}_warp_token_credits.aleo`) {
2297
+ return true;
2298
+ }
2299
+ return p.id().startsWith(`${prefix}_${r.replaceAll('hyp_', '')}`);
2300
+ }) || '',
2301
+ program: p.toString(),
2302
+ }));
2303
+ }
2304
+ //# sourceMappingURL=helper.node.js.map
2305
+ __webpack_async_result__();
2306
+ } catch(e) { __webpack_async_result__(e); } });
2307
+
2308
+ /***/ }),
2309
+
2310
+ /***/ 34941:
2311
+ /***/ ((__webpack_module__, __webpack_exports__, __webpack_require__) => {
2312
+
2313
+ __webpack_require__.a(__webpack_module__, async (__webpack_handle_async_dependencies__, __webpack_async_result__) => { try {
2314
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
2315
+ /* harmony export */ q: () => (/* binding */ AleoValidatorAnnounceArtifactManager)
2316
+ /* harmony export */ });
2317
+ /* harmony import */ var _validator_announce_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69404);
2318
+ var __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([_validator_announce_js__WEBPACK_IMPORTED_MODULE_0__]);
2319
+ _validator_announce_js__WEBPACK_IMPORTED_MODULE_0__ = (__webpack_async_dependencies__.then ? (await __webpack_async_dependencies__)() : __webpack_async_dependencies__)[0];
2320
+
2321
+ /**
2322
+ * Aleo ValidatorAnnounce Artifact Manager implementing IRawValidatorAnnounceArtifactManager.
2323
+ *
2324
+ * This manager:
2325
+ * - Provides factory methods for creating validator announce readers and writers
2326
+ * - Handles validator announce deployment
2327
+ */
2328
+ class AleoValidatorAnnounceArtifactManager {
2329
+ config;
2330
+ aleoClient;
2331
+ constructor(config, aleoClient) {
2332
+ this.config = config;
2333
+ this.aleoClient = aleoClient;
2334
+ }
2335
+ async readValidatorAnnounce(address) {
2336
+ const reader = this.createReader('validatorAnnounce');
2337
+ return reader.read(address);
2338
+ }
2339
+ createReader(_type) {
2340
+ return new _validator_announce_js__WEBPACK_IMPORTED_MODULE_0__/* .AleoValidatorAnnounceReader */ .O(this.aleoClient);
2341
+ }
2342
+ createWriter(_type, signer) {
2343
+ return new _validator_announce_js__WEBPACK_IMPORTED_MODULE_0__/* .AleoValidatorAnnounceWriter */ .w(this.config, this.aleoClient, signer);
2344
+ }
2345
+ }
2346
+ //# sourceMappingURL=validator-announce-artifact-manager.js.map
2347
+ __webpack_async_result__();
2348
+ } catch(e) { __webpack_async_result__(e); } });
2349
+
2350
+ /***/ }),
2351
+
2352
+ /***/ 23551:
2353
+ /***/ ((__webpack_module__, __webpack_exports__, __webpack_require__) => {
2354
+
2355
+ __webpack_require__.a(__webpack_module__, async (__webpack_handle_async_dependencies__, __webpack_async_result__) => { try {
2356
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
2357
+ /* harmony export */ k: () => (/* binding */ getValidatorAnnounceConfig)
2358
+ /* harmony export */ });
2359
+ /* harmony import */ var _provablehq_sdk__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(83684);
2360
+ /* harmony import */ var _recoillink_utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(21387);
2361
+ /* harmony import */ var _utils_base_query_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(40363);
2362
+ /* harmony import */ var _utils_helper_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(15952);
2363
+ var __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([_provablehq_sdk__WEBPACK_IMPORTED_MODULE_0__, _utils_base_query_js__WEBPACK_IMPORTED_MODULE_1__]);
2364
+ ([_provablehq_sdk__WEBPACK_IMPORTED_MODULE_0__, _utils_base_query_js__WEBPACK_IMPORTED_MODULE_1__] = __webpack_async_dependencies__.then ? (await __webpack_async_dependencies__)() : __webpack_async_dependencies__);
2365
+
2366
+
2367
+
2368
+
2369
+ /**
2370
+ * Query validator announce configuration from the chain.
2371
+ *
2372
+ * @param aleoClient - The Aleo network client
2373
+ * @param validatorAnnounceAddress - The full validator announce address (e.g., "validator_announce.aleo/aleo1...")
2374
+ * @returns The validator announce configuration with address and plain mailbox address (aleo1... format).
2375
+ * Note: The mailbox address is returned as a plain address because the validator announce program
2376
+ * does not import the mailbox program, so the program ID cannot be resolved from on-chain state.
2377
+ */
2378
+ async function getValidatorAnnounceConfig(aleoClient, validatorAnnounceAddress) {
2379
+ const { programId } = (0,_utils_helper_js__WEBPACK_IMPORTED_MODULE_2__/* .fromAleoAddress */ .kz)(validatorAnnounceAddress);
2380
+ (0,_recoillink_utils__WEBPACK_IMPORTED_MODULE_3__/* .assert */ .v)(programId, `Program Id is required for reading the on chain validator announce config. Is the input address formatted as "programId/address"?`);
2381
+ const validatorAnnounceData = await (0,_utils_base_query_js__WEBPACK_IMPORTED_MODULE_1__/* .queryMappingValue */ .YR)(aleoClient, programId, 'validator_announce', 'true', (raw) => {
2382
+ const data = raw;
2383
+ (0,_recoillink_utils__WEBPACK_IMPORTED_MODULE_3__/* .assert */ .v)(data?.mailbox, `Invalid validator announce data structure for validator announce ${validatorAnnounceAddress}, expected object with mailbox field`);
2384
+ return data;
2385
+ });
2386
+ // Convert mailbox address from bytes to human-readable string
2387
+ // The mailbox field is stored as [u8; 32u32] bytes on chain
2388
+ // Note: Only the plain address is available because the validator announce
2389
+ // program does not import the mailbox program on chain.
2390
+ const mailboxAddress = _provablehq_sdk__WEBPACK_IMPORTED_MODULE_0__.Address.fromBytesLe(Uint8Array.from(validatorAnnounceData.mailbox)).to_string();
2391
+ return {
2392
+ address: validatorAnnounceAddress,
2393
+ mailboxAddress,
2394
+ };
2395
+ }
2396
+ //# sourceMappingURL=validator-announce-query.js.map
2397
+ __webpack_async_result__();
2398
+ } catch(e) { __webpack_async_result__(e); } });
2399
+
2400
+ /***/ }),
2401
+
2402
+ /***/ 65637:
2403
+ /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
2404
+
2405
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
2406
+ /* harmony export */ g: () => (/* binding */ getCreateValidatorAnnounceTx)
2407
+ /* harmony export */ });
2408
+ /* harmony import */ var _utils_helper_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(15952);
2409
+
2410
+ /**
2411
+ * Build transaction to create a validator announce
2412
+ *
2413
+ * @param validatorAnnounceProgramId - The validator announce program ID
2414
+ * @param mailboxAddress - The plain mailbox address (without program prefix)
2415
+ * @param localDomain - The local domain ID
2416
+ * @returns The transaction object
2417
+ */
2418
+ function getCreateValidatorAnnounceTx(validatorAnnounceProgramId, mailboxAddress, localDomain) {
2419
+ const { address: mailboxPlainAddress } = (0,_utils_helper_js__WEBPACK_IMPORTED_MODULE_0__/* .fromAleoAddress */ .kz)(mailboxAddress);
2420
+ return {
2421
+ programName: validatorAnnounceProgramId,
2422
+ functionName: 'init',
2423
+ priorityFee: 0,
2424
+ privateFee: false,
2425
+ inputs: [mailboxPlainAddress, `${localDomain}u32`],
2426
+ };
2427
+ }
2428
+ //# sourceMappingURL=validator-announce-tx.js.map
2429
+
2430
+ /***/ }),
2431
+
2432
+ /***/ 69404:
2433
+ /***/ ((__webpack_module__, __webpack_exports__, __webpack_require__) => {
2434
+
2435
+ __webpack_require__.a(__webpack_module__, async (__webpack_handle_async_dependencies__, __webpack_async_result__) => { try {
2436
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
2437
+ /* harmony export */ O: () => (/* binding */ AleoValidatorAnnounceReader),
2438
+ /* harmony export */ w: () => (/* binding */ AleoValidatorAnnounceWriter)
2439
+ /* harmony export */ });
2440
+ /* harmony import */ var _recoillink_provider_sdk_artifact__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4287);
2441
+ /* harmony import */ var _recoillink_utils__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(21387);
2442
+ /* harmony import */ var _mailbox_mailbox_query_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(4099);
2443
+ /* harmony import */ var _utils_helper_crypto_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(44996);
2444
+ /* harmony import */ var _utils_helper_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(15952);
2445
+ /* harmony import */ var _validator_announce_query_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(23551);
2446
+ /* harmony import */ var _validator_announce_tx_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(65637);
2447
+ var __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([_mailbox_mailbox_query_js__WEBPACK_IMPORTED_MODULE_1__, _utils_helper_crypto_js__WEBPACK_IMPORTED_MODULE_2__, _validator_announce_query_js__WEBPACK_IMPORTED_MODULE_4__]);
2448
+ ([_mailbox_mailbox_query_js__WEBPACK_IMPORTED_MODULE_1__, _utils_helper_crypto_js__WEBPACK_IMPORTED_MODULE_2__, _validator_announce_query_js__WEBPACK_IMPORTED_MODULE_4__] = __webpack_async_dependencies__.then ? (await __webpack_async_dependencies__)() : __webpack_async_dependencies__);
2449
+
2450
+
2451
+
2452
+
2453
+
2454
+
2455
+
2456
+ /**
2457
+ * Reader for Aleo ValidatorAnnounce.
2458
+ * Reads deployed validator announce configuration from the chain.
2459
+ */
2460
+ class AleoValidatorAnnounceReader {
2461
+ aleoClient;
2462
+ constructor(aleoClient) {
2463
+ this.aleoClient = aleoClient;
2464
+ }
2465
+ async read(address) {
2466
+ const validatorAnnounceConfig = await (0,_validator_announce_query_js__WEBPACK_IMPORTED_MODULE_4__/* .getValidatorAnnounceConfig */ .k)(this.aleoClient, address);
2467
+ return {
2468
+ artifactState: _recoillink_provider_sdk_artifact__WEBPACK_IMPORTED_MODULE_0__/* .ArtifactState */ .O2.DEPLOYED,
2469
+ config: {
2470
+ mailboxAddress: validatorAnnounceConfig.mailboxAddress,
2471
+ },
2472
+ deployed: {
2473
+ address: validatorAnnounceConfig.address,
2474
+ },
2475
+ };
2476
+ }
2477
+ }
2478
+ /**
2479
+ * Writer for Aleo ValidatorAnnounce.
2480
+ * Handles deployment. ValidatorAnnounce is immutable after deployment.
2481
+ */
2482
+ class AleoValidatorAnnounceWriter extends AleoValidatorAnnounceReader {
2483
+ config;
2484
+ signer;
2485
+ constructor(config, aleoClient, signer) {
2486
+ super(aleoClient);
2487
+ this.config = config;
2488
+ this.signer = signer;
2489
+ }
2490
+ async create(artifact) {
2491
+ const { config } = artifact;
2492
+ const allReceipts = [];
2493
+ // 1. Deploy validator_announce program
2494
+ const prefix = (0,_utils_helper_js__WEBPACK_IMPORTED_MODULE_3__/* .getNetworkPrefix */ .nA)(this.config.aleoNetworkId);
2495
+ const validatorAnnounceSuffix = await (0,_utils_helper_js__WEBPACK_IMPORTED_MODULE_3__/* .getUnusedSuffix */ .ED)(this.aleoClient, prefix, 'validator_announce', _utils_helper_js__WEBPACK_IMPORTED_MODULE_3__/* .SUFFIX_LENGTH_SHORT */ .me);
2496
+ const programs = await this.signer.deployProgram('validator_announce', validatorAnnounceSuffix);
2497
+ const validatorAnnounceProgramId = programs['validator_announce'];
2498
+ (0,_recoillink_utils__WEBPACK_IMPORTED_MODULE_6__/* .assert */ .v)(validatorAnnounceProgramId, 'validator announce program not deployed');
2499
+ // 2. Query mailbox for localDomain
2500
+ const mailboxConfig = await (0,_mailbox_mailbox_query_js__WEBPACK_IMPORTED_MODULE_1__/* .getMailboxConfig */ .x)(this.aleoClient, config.mailboxAddress);
2501
+ // 3. Initialize validator announce with mailbox address and local domain
2502
+ const createTx = (0,_validator_announce_tx_js__WEBPACK_IMPORTED_MODULE_5__/* .getCreateValidatorAnnounceTx */ .g)(validatorAnnounceProgramId, config.mailboxAddress, mailboxConfig.localDomain);
2503
+ const createReceipt = await this.signer.sendAndConfirmTransaction(createTx);
2504
+ allReceipts.push(createReceipt);
2505
+ const deployedArtifact = {
2506
+ artifactState: _recoillink_provider_sdk_artifact__WEBPACK_IMPORTED_MODULE_0__/* .ArtifactState */ .O2.DEPLOYED,
2507
+ config: artifact.config,
2508
+ deployed: {
2509
+ address: (0,_utils_helper_crypto_js__WEBPACK_IMPORTED_MODULE_2__/* .toAleoAddress */ .j2)(validatorAnnounceProgramId),
2510
+ },
2511
+ };
2512
+ return [deployedArtifact, allReceipts];
2513
+ }
2514
+ async update(_artifact) {
2515
+ // ValidatorAnnounce has no mutable state - mailbox address is set at creation
2516
+ return [];
2517
+ }
2518
+ }
2519
+ //# sourceMappingURL=validator-announce.js.map
2520
+ __webpack_async_result__();
2521
+ } catch(e) { __webpack_async_result__(e); } });
2522
+
2523
+ /***/ }),
2524
+
2525
+ /***/ 12763:
2526
+ /***/ ((__webpack_module__, __webpack_exports__, __webpack_require__) => {
2527
+
2528
+ __webpack_require__.a(__webpack_module__, async (__webpack_handle_async_dependencies__, __webpack_async_result__) => { try {
2529
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
2530
+ /* harmony export */ P: () => (/* binding */ AleoCollateralTokenReader),
2531
+ /* harmony export */ x: () => (/* binding */ AleoCollateralTokenWriter)
2532
+ /* harmony export */ });
2533
+ /* harmony import */ var _recoillink_provider_sdk_artifact__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4287);
2534
+ /* harmony import */ var _recoillink_provider_sdk_warp__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(17791);
2535
+ /* harmony import */ var _recoillink_utils__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(21387);
2536
+ /* harmony import */ var _utils_helper_crypto_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(44996);
2537
+ /* harmony import */ var _utils_helper_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(15952);
2538
+ /* harmony import */ var _utils_types_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(96602);
2539
+ /* harmony import */ var _warp_query_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(69661);
2540
+ /* harmony import */ var _warp_tx_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(29197);
2541
+ var __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([_utils_helper_crypto_js__WEBPACK_IMPORTED_MODULE_2__, _warp_query_js__WEBPACK_IMPORTED_MODULE_5__, _warp_tx_js__WEBPACK_IMPORTED_MODULE_6__]);
2542
+ ([_utils_helper_crypto_js__WEBPACK_IMPORTED_MODULE_2__, _warp_query_js__WEBPACK_IMPORTED_MODULE_5__, _warp_tx_js__WEBPACK_IMPORTED_MODULE_6__] = __webpack_async_dependencies__.then ? (await __webpack_async_dependencies__)() : __webpack_async_dependencies__);
2543
+
2544
+
2545
+
2546
+
2547
+
2548
+
2549
+
2550
+
2551
+ function withErrorContext(context, error) {
2552
+ const message = error instanceof Error ? error.message : String(error);
2553
+ return new Error(`${context}: ${message}`);
2554
+ }
2555
+ class AleoCollateralTokenReader {
2556
+ aleoClient;
2557
+ onChainArtifactManagers;
2558
+ constructor(aleoClient, onChainArtifactManagers) {
2559
+ this.aleoClient = aleoClient;
2560
+ this.onChainArtifactManagers = onChainArtifactManagers;
2561
+ }
2562
+ async read(address) {
2563
+ // Fetch token config using internal Aleo types
2564
+ const token = await (0,_warp_query_js__WEBPACK_IMPORTED_MODULE_5__/* .getCollateralWarpTokenConfig */ .NV)(this.aleoClient, address, this.onChainArtifactManagers.ismManagerAddress, this.onChainArtifactManagers.hookManagerAddress).catch((error) => {
2565
+ throw withErrorContext(`Failed to read collateral warp token ${address} (ismManager=${this.onChainArtifactManagers.ismManagerAddress}, hookManager=${this.onChainArtifactManagers.hookManagerAddress})`, error);
2566
+ });
2567
+ // Convert to provider-sdk artifact format
2568
+ const { destinationGas, remoteRouters, interchainSecurityModule, hook } = (0,_utils_types_js__WEBPACK_IMPORTED_MODULE_4__/* .aleoWarpFieldsToArtifactApi */ .IZ)(token);
2569
+ const config = {
2570
+ type: _recoillink_provider_sdk_warp__WEBPACK_IMPORTED_MODULE_1__/* .TokenType */ .ks.collateral,
2571
+ owner: token.owner,
2572
+ mailbox: token.mailbox,
2573
+ destinationGas,
2574
+ remoteRouters,
2575
+ interchainSecurityModule,
2576
+ hook,
2577
+ token: token.token,
2578
+ name: token.name,
2579
+ symbol: token.symbol,
2580
+ decimals: token.decimals,
2581
+ scale: token.scale,
2582
+ };
2583
+ return {
2584
+ artifactState: _recoillink_provider_sdk_artifact__WEBPACK_IMPORTED_MODULE_0__/* .ArtifactState */ .O2.DEPLOYED,
2585
+ config,
2586
+ deployed: {
2587
+ address,
2588
+ },
2589
+ };
2590
+ }
2591
+ }
2592
+ class AleoCollateralTokenWriter extends AleoCollateralTokenReader {
2593
+ signer;
2594
+ constructor(aleoClient, signer, onChainArtifactManagers) {
2595
+ super(aleoClient, onChainArtifactManagers);
2596
+ this.signer = signer;
2597
+ }
2598
+ async create(artifact) {
2599
+ const { config } = artifact;
2600
+ const allReceipts = [];
2601
+ const signerAddress = this.signer.getSignerAddress();
2602
+ // Get mailbox suffix for deployment
2603
+ const { programId: mailboxProgramId } = (0,_utils_helper_js__WEBPACK_IMPORTED_MODULE_3__/* .fromAleoAddress */ .kz)(config.mailbox);
2604
+ const mailboxSuffix = (0,_utils_helper_js__WEBPACK_IMPORTED_MODULE_3__/* .getProgramSuffix */ .GC)(mailboxProgramId);
2605
+ // Resolve token suffix from preferred setting or generate a collision-free one
2606
+ const tokenSuffix = await this.signer.getWarpTokenSuffix('collateral');
2607
+ // Deploy collateral token program
2608
+ const programs = await this.signer
2609
+ .deployProgram('hyp_collateral', mailboxSuffix, tokenSuffix)
2610
+ .catch((error) => {
2611
+ throw withErrorContext(`Failed to deployProgram(hyp_collateral) for mailbox ${config.mailbox} (signer=${signerAddress})`, error);
2612
+ });
2613
+ const tokenProgramId = programs['hyp_collateral'];
2614
+ (0,_recoillink_utils__WEBPACK_IMPORTED_MODULE_7__/* .assert */ .v)(tokenProgramId, 'Expected collateral token program to be deployed but none was found in deployment mapping');
2615
+ // Initialize token
2616
+ const initTx = await (0,_warp_tx_js__WEBPACK_IMPORTED_MODULE_6__/* .getCreateCollateralTokenTx */ .RN)(this.aleoClient, tokenProgramId, config.token);
2617
+ const initReceipt = await this.signer
2618
+ .sendAndConfirmTransaction(initTx)
2619
+ .catch((error) => {
2620
+ throw withErrorContext(`Failed to initialize collateral warp token program ${tokenProgramId} (token=${config.token}, signer=${signerAddress})`, error);
2621
+ });
2622
+ allReceipts.push(initReceipt);
2623
+ const tokenAddress = (0,_utils_helper_crypto_js__WEBPACK_IMPORTED_MODULE_2__/* .toAleoAddress */ .j2)(tokenProgramId);
2624
+ // Perform post-deployment updates (ISM setup and router enrollment)
2625
+ const postDeploymentTxs = (0,_warp_tx_js__WEBPACK_IMPORTED_MODULE_6__/* .getPostDeploymentUpdateTxs */ .UL)(tokenAddress, config);
2626
+ for (const tx of postDeploymentTxs) {
2627
+ const receipt = await this.signer
2628
+ .sendAndConfirmTransaction(tx)
2629
+ .catch((error) => {
2630
+ throw withErrorContext(`Failed post-deployment step ${tx.programName}.${tx.functionName} for collateral warp token ${tokenAddress} (signer=${signerAddress})`, error);
2631
+ });
2632
+ allReceipts.push(receipt);
2633
+ }
2634
+ const deployedArtifact = {
2635
+ artifactState: _recoillink_provider_sdk_artifact__WEBPACK_IMPORTED_MODULE_0__/* .ArtifactState */ .O2.DEPLOYED,
2636
+ config: artifact.config,
2637
+ deployed: {
2638
+ address: tokenAddress,
2639
+ },
2640
+ };
2641
+ return [deployedArtifact, allReceipts];
2642
+ }
2643
+ async update(artifact) {
2644
+ // Read current state from chain
2645
+ const currentArtifact = await this.read(artifact.deployed.address);
2646
+ // Generate update transactions
2647
+ return (0,_warp_tx_js__WEBPACK_IMPORTED_MODULE_6__/* .getWarpTokenUpdateTxs */ .cf)(artifact, currentArtifact);
2648
+ }
2649
+ }
2650
+ //# sourceMappingURL=collateral-token.js.map
2651
+ __webpack_async_result__();
2652
+ } catch(e) { __webpack_async_result__(e); } });
2653
+
2654
+ /***/ }),
2655
+
2656
+ /***/ 2685:
2657
+ /***/ ((__webpack_module__, __webpack_exports__, __webpack_require__) => {
2658
+
2659
+ __webpack_require__.a(__webpack_module__, async (__webpack_handle_async_dependencies__, __webpack_async_result__) => { try {
2660
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
2661
+ /* harmony export */ H: () => (/* binding */ AleoNativeTokenWriter),
2662
+ /* harmony export */ b: () => (/* binding */ AleoNativeTokenReader)
2663
+ /* harmony export */ });
2664
+ /* harmony import */ var _recoillink_provider_sdk_artifact__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4287);
2665
+ /* harmony import */ var _recoillink_provider_sdk_warp__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(17791);
2666
+ /* harmony import */ var _recoillink_utils__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(21387);
2667
+ /* harmony import */ var _utils_helper_crypto_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(44996);
2668
+ /* harmony import */ var _utils_helper_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(15952);
2669
+ /* harmony import */ var _utils_types_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(96602);
2670
+ /* harmony import */ var _warp_query_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(69661);
2671
+ /* harmony import */ var _warp_tx_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(29197);
2672
+ var __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([_utils_helper_crypto_js__WEBPACK_IMPORTED_MODULE_2__, _warp_query_js__WEBPACK_IMPORTED_MODULE_5__, _warp_tx_js__WEBPACK_IMPORTED_MODULE_6__]);
2673
+ ([_utils_helper_crypto_js__WEBPACK_IMPORTED_MODULE_2__, _warp_query_js__WEBPACK_IMPORTED_MODULE_5__, _warp_tx_js__WEBPACK_IMPORTED_MODULE_6__] = __webpack_async_dependencies__.then ? (await __webpack_async_dependencies__)() : __webpack_async_dependencies__);
2674
+
2675
+
2676
+
2677
+
2678
+
2679
+
2680
+
2681
+
2682
+ function withErrorContext(context, error) {
2683
+ const message = error instanceof Error ? error.message : String(error);
2684
+ return new Error(`${context}: ${message}`);
2685
+ }
2686
+ class AleoNativeTokenReader {
2687
+ aleoClient;
2688
+ onChainArtifactManagers;
2689
+ constructor(aleoClient, onChainArtifactManagers) {
2690
+ this.aleoClient = aleoClient;
2691
+ this.onChainArtifactManagers = onChainArtifactManagers;
2692
+ }
2693
+ async read(address) {
2694
+ // Fetch token config using internal Aleo types
2695
+ const token = await (0,_warp_query_js__WEBPACK_IMPORTED_MODULE_5__/* .getNativeWarpTokenConfig */ .rX)(this.aleoClient, address, this.onChainArtifactManagers.ismManagerAddress, this.onChainArtifactManagers.hookManagerAddress).catch((error) => {
2696
+ throw withErrorContext(`Failed to read native warp token ${address} (ismManager=${this.onChainArtifactManagers.ismManagerAddress}, hookManager=${this.onChainArtifactManagers.hookManagerAddress})`, error);
2697
+ });
2698
+ // Convert to provider-sdk artifact format
2699
+ const { destinationGas, remoteRouters, interchainSecurityModule, hook } = (0,_utils_types_js__WEBPACK_IMPORTED_MODULE_4__/* .aleoWarpFieldsToArtifactApi */ .IZ)(token);
2700
+ const config = {
2701
+ type: _recoillink_provider_sdk_warp__WEBPACK_IMPORTED_MODULE_1__/* .TokenType */ .ks.native,
2702
+ owner: token.owner,
2703
+ mailbox: token.mailbox,
2704
+ destinationGas,
2705
+ remoteRouters,
2706
+ interchainSecurityModule,
2707
+ hook,
2708
+ scale: token.scale,
2709
+ };
2710
+ return {
2711
+ artifactState: _recoillink_provider_sdk_artifact__WEBPACK_IMPORTED_MODULE_0__/* .ArtifactState */ .O2.DEPLOYED,
2712
+ config,
2713
+ deployed: {
2714
+ address,
2715
+ },
2716
+ };
2717
+ }
2718
+ }
2719
+ class AleoNativeTokenWriter extends AleoNativeTokenReader {
2720
+ signer;
2721
+ constructor(aleoClient, signer, onChainArtifactManagers) {
2722
+ super(aleoClient, onChainArtifactManagers);
2723
+ this.signer = signer;
2724
+ }
2725
+ async create(artifact) {
2726
+ const { config } = artifact;
2727
+ const allReceipts = [];
2728
+ const signerAddress = this.signer.getSignerAddress();
2729
+ // Get mailbox suffix for deployment
2730
+ const { programId: mailboxProgramId } = (0,_utils_helper_js__WEBPACK_IMPORTED_MODULE_3__/* .fromAleoAddress */ .kz)(config.mailbox);
2731
+ const mailboxSuffix = (0,_utils_helper_js__WEBPACK_IMPORTED_MODULE_3__/* .getProgramSuffix */ .GC)(mailboxProgramId);
2732
+ // Resolve token suffix from preferred setting or generate a collision-free one.
2733
+ // Native tokens always use the fixed 'credits' suffix, so the program may
2734
+ // already be deployed and initialized from a previous warp deploy run.
2735
+ const tokenSuffix = await this.signer.getWarpTokenSuffix('native');
2736
+ // Deploy native token program (idempotent if already on-chain)
2737
+ const programs = await this.signer
2738
+ .deployProgram('hyp_native', mailboxSuffix, tokenSuffix)
2739
+ .catch((error) => {
2740
+ throw withErrorContext(`Failed to deployProgram(hyp_native) for mailbox ${config.mailbox} (signer=${signerAddress})`, error);
2741
+ });
2742
+ const tokenProgramId = programs['hyp_native'];
2743
+ (0,_recoillink_utils__WEBPACK_IMPORTED_MODULE_7__/* .assert */ .v)(tokenProgramId, 'Expected native token program to be deployed but none was found in deployment mapping');
2744
+ const tokenAddress = (0,_utils_helper_crypto_js__WEBPACK_IMPORTED_MODULE_2__/* .toAleoAddress */ .j2)(tokenProgramId);
2745
+ // Native tokens use a fixed program name (no random suffix), so only one
2746
+ // native warp token can exist per network. If it's already initialized,
2747
+ // fail early with a clear message instead of letting init fail on-chain.
2748
+ const existingArtifact = await this.read(tokenAddress).catch(() => null);
2749
+ if (existingArtifact) {
2750
+ throw new Error(`Native warp token ${tokenProgramId} is already deployed at ${tokenAddress}. ` +
2751
+ `Native tokens cannot be redeployed. Use \`hyperlane warp apply\` to update the existing deployment.`);
2752
+ }
2753
+ // Initialize token
2754
+ const initTx = (0,_warp_tx_js__WEBPACK_IMPORTED_MODULE_6__/* .getCreateNativeTokenTx */ .zf)(tokenProgramId);
2755
+ const initReceipt = await this.signer
2756
+ .sendAndConfirmTransaction(initTx)
2757
+ .catch((error) => {
2758
+ throw withErrorContext(`Failed to initialize native warp token program ${tokenProgramId} (signer=${signerAddress})`, error);
2759
+ });
2760
+ allReceipts.push(initReceipt);
2761
+ // Perform post-deployment updates (ISM setup and router enrollment)
2762
+ const postDeploymentTxs = (0,_warp_tx_js__WEBPACK_IMPORTED_MODULE_6__/* .getPostDeploymentUpdateTxs */ .UL)(tokenAddress, config);
2763
+ for (const tx of postDeploymentTxs) {
2764
+ const receipt = await this.signer
2765
+ .sendAndConfirmTransaction(tx)
2766
+ .catch((error) => {
2767
+ throw withErrorContext(`Failed post-deployment step ${tx.programName}.${tx.functionName} for native warp token ${tokenAddress} (signer=${signerAddress})`, error);
2768
+ });
2769
+ allReceipts.push(receipt);
2770
+ }
2771
+ const deployedArtifact = {
2772
+ artifactState: _recoillink_provider_sdk_artifact__WEBPACK_IMPORTED_MODULE_0__/* .ArtifactState */ .O2.DEPLOYED,
2773
+ config: artifact.config,
2774
+ deployed: {
2775
+ address: tokenAddress,
2776
+ },
2777
+ };
2778
+ return [deployedArtifact, allReceipts];
2779
+ }
2780
+ async update(artifact) {
2781
+ // Read current state from chain
2782
+ const currentArtifact = await this.read(artifact.deployed.address);
2783
+ // Generate update transactions
2784
+ return (0,_warp_tx_js__WEBPACK_IMPORTED_MODULE_6__/* .getWarpTokenUpdateTxs */ .cf)(artifact, currentArtifact);
2785
+ }
2786
+ }
2787
+ //# sourceMappingURL=native-token.js.map
2788
+ __webpack_async_result__();
2789
+ } catch(e) { __webpack_async_result__(e); } });
2790
+
2791
+ /***/ }),
2792
+
2793
+ /***/ 43275:
2794
+ /***/ ((__webpack_module__, __webpack_exports__, __webpack_require__) => {
2795
+
2796
+ __webpack_require__.a(__webpack_module__, async (__webpack_handle_async_dependencies__, __webpack_async_result__) => { try {
2797
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
2798
+ /* harmony export */ h: () => (/* binding */ AleoSyntheticTokenReader),
2799
+ /* harmony export */ l: () => (/* binding */ AleoSyntheticTokenWriter)
2800
+ /* harmony export */ });
2801
+ /* harmony import */ var _recoillink_provider_sdk_artifact__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4287);
2802
+ /* harmony import */ var _recoillink_provider_sdk_warp__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(17791);
2803
+ /* harmony import */ var _recoillink_utils__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(21387);
2804
+ /* harmony import */ var _utils_helper_crypto_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(44996);
2805
+ /* harmony import */ var _utils_helper_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(15952);
2806
+ /* harmony import */ var _utils_types_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(96602);
2807
+ /* harmony import */ var _warp_query_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(69661);
2808
+ /* harmony import */ var _warp_tx_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(29197);
2809
+ var __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([_utils_helper_crypto_js__WEBPACK_IMPORTED_MODULE_2__, _warp_query_js__WEBPACK_IMPORTED_MODULE_5__, _warp_tx_js__WEBPACK_IMPORTED_MODULE_6__]);
2810
+ ([_utils_helper_crypto_js__WEBPACK_IMPORTED_MODULE_2__, _warp_query_js__WEBPACK_IMPORTED_MODULE_5__, _warp_tx_js__WEBPACK_IMPORTED_MODULE_6__] = __webpack_async_dependencies__.then ? (await __webpack_async_dependencies__)() : __webpack_async_dependencies__);
2811
+
2812
+
2813
+
2814
+
2815
+
2816
+
2817
+
2818
+
2819
+ function withErrorContext(context, error) {
2820
+ const message = error instanceof Error ? error.message : String(error);
2821
+ return new Error(`${context}: ${message}`);
2822
+ }
2823
+ class AleoSyntheticTokenReader {
2824
+ aleoClient;
2825
+ onChainArtifactManagers;
2826
+ constructor(aleoClient, onChainArtifactManagers) {
2827
+ this.aleoClient = aleoClient;
2828
+ this.onChainArtifactManagers = onChainArtifactManagers;
2829
+ }
2830
+ async read(address) {
2831
+ // Fetch token config using internal Aleo types
2832
+ const token = await (0,_warp_query_js__WEBPACK_IMPORTED_MODULE_5__/* .getSyntheticWarpTokenConfig */ .nu)(this.aleoClient, address, this.onChainArtifactManagers.ismManagerAddress, this.onChainArtifactManagers.hookManagerAddress).catch((error) => {
2833
+ throw withErrorContext(`Failed to read synthetic warp token ${address} (ismManager=${this.onChainArtifactManagers.ismManagerAddress}, hookManager=${this.onChainArtifactManagers.hookManagerAddress})`, error);
2834
+ });
2835
+ // Convert to provider-sdk artifact format
2836
+ const { destinationGas, remoteRouters, interchainSecurityModule, hook } = (0,_utils_types_js__WEBPACK_IMPORTED_MODULE_4__/* .aleoWarpFieldsToArtifactApi */ .IZ)(token);
2837
+ const config = {
2838
+ type: _recoillink_provider_sdk_warp__WEBPACK_IMPORTED_MODULE_1__/* .TokenType */ .ks.synthetic,
2839
+ owner: token.owner,
2840
+ mailbox: token.mailbox,
2841
+ destinationGas,
2842
+ remoteRouters,
2843
+ interchainSecurityModule,
2844
+ hook,
2845
+ name: token.name,
2846
+ symbol: token.symbol,
2847
+ decimals: token.decimals,
2848
+ scale: token.scale,
2849
+ };
2850
+ return {
2851
+ artifactState: _recoillink_provider_sdk_artifact__WEBPACK_IMPORTED_MODULE_0__/* .ArtifactState */ .O2.DEPLOYED,
2852
+ config,
2853
+ deployed: {
2854
+ address,
2855
+ },
2856
+ };
2857
+ }
2858
+ }
2859
+ class AleoSyntheticTokenWriter extends AleoSyntheticTokenReader {
2860
+ signer;
2861
+ constructor(aleoClient, signer, onChainArtifactManagers) {
2862
+ super(aleoClient, onChainArtifactManagers);
2863
+ this.signer = signer;
2864
+ }
2865
+ async create(artifact) {
2866
+ const { config } = artifact;
2867
+ const remoteDecimals = (0,_warp_tx_js__WEBPACK_IMPORTED_MODULE_6__/* .scaleToRemoteDecimals */ .uB)(config.decimals, config.scale);
2868
+ const allReceipts = [];
2869
+ const signerAddress = this.signer.getSignerAddress();
2870
+ // Get mailbox suffix for deployment
2871
+ const { programId: mailboxProgramId } = (0,_utils_helper_js__WEBPACK_IMPORTED_MODULE_3__/* .fromAleoAddress */ .kz)(config.mailbox);
2872
+ const mailboxSuffix = (0,_utils_helper_js__WEBPACK_IMPORTED_MODULE_3__/* .getProgramSuffix */ .GC)(mailboxProgramId);
2873
+ // Resolve token suffix from preferred setting or generate a collision-free one
2874
+ const tokenSuffix = await this.signer.getWarpTokenSuffix('synthetic');
2875
+ // Deploy synthetic token program
2876
+ const programs = await this.signer
2877
+ .deployProgram('hyp_synthetic', mailboxSuffix, tokenSuffix)
2878
+ .catch((error) => {
2879
+ throw withErrorContext(`Failed to deployProgram(hyp_synthetic) for mailbox ${config.mailbox} (signer=${signerAddress})`, error);
2880
+ });
2881
+ const tokenProgramId = programs['hyp_synthetic'];
2882
+ (0,_recoillink_utils__WEBPACK_IMPORTED_MODULE_7__/* .assert */ .v)(tokenProgramId, 'Expected synthetic token program to be deployed but none was found in deployment mapping');
2883
+ // Initialize token
2884
+ const initTx = (0,_warp_tx_js__WEBPACK_IMPORTED_MODULE_6__/* .getCreateSyntheticTokenTx */ .ln)(tokenProgramId, config.name, config.symbol, config.decimals, remoteDecimals);
2885
+ const initReceipt = await this.signer
2886
+ .sendAndConfirmTransaction(initTx)
2887
+ .catch((error) => {
2888
+ throw withErrorContext(`Failed to initialize synthetic warp token program ${tokenProgramId} (signer=${signerAddress})`, error);
2889
+ });
2890
+ allReceipts.push(initReceipt);
2891
+ const tokenAddress = (0,_utils_helper_crypto_js__WEBPACK_IMPORTED_MODULE_2__/* .toAleoAddress */ .j2)(tokenProgramId);
2892
+ // Perform post-deployment updates (ISM setup and router enrollment)
2893
+ const postDeploymentTxs = (0,_warp_tx_js__WEBPACK_IMPORTED_MODULE_6__/* .getPostDeploymentUpdateTxs */ .UL)(tokenAddress, config);
2894
+ for (const tx of postDeploymentTxs) {
2895
+ const receipt = await this.signer
2896
+ .sendAndConfirmTransaction(tx)
2897
+ .catch((error) => {
2898
+ throw withErrorContext(`Failed post-deployment step ${tx.programName}.${tx.functionName} for synthetic warp token ${tokenAddress} (signer=${signerAddress})`, error);
2899
+ });
2900
+ allReceipts.push(receipt);
2901
+ }
2902
+ const deployedArtifact = {
2903
+ artifactState: _recoillink_provider_sdk_artifact__WEBPACK_IMPORTED_MODULE_0__/* .ArtifactState */ .O2.DEPLOYED,
2904
+ config: artifact.config,
2905
+ deployed: {
2906
+ address: tokenAddress,
2907
+ },
2908
+ };
2909
+ return [deployedArtifact, allReceipts];
2910
+ }
2911
+ async update(artifact) {
2912
+ // Read current state from chain
2913
+ const currentArtifact = await this.read(artifact.deployed.address);
2914
+ // Generate update transactions
2915
+ return (0,_warp_tx_js__WEBPACK_IMPORTED_MODULE_6__/* .getWarpTokenUpdateTxs */ .cf)(artifact, currentArtifact);
2916
+ }
2917
+ }
2918
+ //# sourceMappingURL=synthetic-token.js.map
2919
+ __webpack_async_result__();
2920
+ } catch(e) { __webpack_async_result__(e); } });
2921
+
2922
+ /***/ }),
2923
+
2924
+ /***/ 41045:
2925
+ /***/ ((__webpack_module__, __webpack_exports__, __webpack_require__) => {
2926
+
2927
+ __webpack_require__.a(__webpack_module__, async (__webpack_handle_async_dependencies__, __webpack_async_result__) => { try {
2928
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
2929
+ /* harmony export */ V: () => (/* binding */ AleoWarpArtifactManager)
2930
+ /* harmony export */ });
2931
+ /* harmony import */ var _utils_helper_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(15952);
2932
+ /* harmony import */ var _collateral_token_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(12763);
2933
+ /* harmony import */ var _native_token_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(2685);
2934
+ /* harmony import */ var _synthetic_token_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(43275);
2935
+ /* harmony import */ var _warp_query_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(69661);
2936
+ var __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([_collateral_token_js__WEBPACK_IMPORTED_MODULE_1__, _native_token_js__WEBPACK_IMPORTED_MODULE_2__, _synthetic_token_js__WEBPACK_IMPORTED_MODULE_3__, _warp_query_js__WEBPACK_IMPORTED_MODULE_4__]);
2937
+ ([_collateral_token_js__WEBPACK_IMPORTED_MODULE_1__, _native_token_js__WEBPACK_IMPORTED_MODULE_2__, _synthetic_token_js__WEBPACK_IMPORTED_MODULE_3__, _warp_query_js__WEBPACK_IMPORTED_MODULE_4__] = __webpack_async_dependencies__.then ? (await __webpack_async_dependencies__)() : __webpack_async_dependencies__);
2938
+
2939
+
2940
+
2941
+
2942
+
2943
+ class AleoWarpArtifactManager {
2944
+ aleoClient;
2945
+ onChainArtifactManagers;
2946
+ constructor(aleoClient, onChainArtifactManagers) {
2947
+ this.aleoClient = aleoClient;
2948
+ this.onChainArtifactManagers = onChainArtifactManagers;
2949
+ }
2950
+ supportsHookUpdates() {
2951
+ return true;
2952
+ }
2953
+ async readWarpToken(address) {
2954
+ // Detect warp token type first
2955
+ const aleoTokenType = await (0,_warp_query_js__WEBPACK_IMPORTED_MODULE_4__/* .getAleoWarpTokenType */ .D1)(this.aleoClient, address);
2956
+ // Convert to provider-sdk WarpType
2957
+ const warpType = (0,_utils_helper_js__WEBPACK_IMPORTED_MODULE_0__/* .providerWarpTokenTypeFromAleoTokenType */ .NL)(aleoTokenType);
2958
+ // Get the appropriate reader and read the token
2959
+ const reader = this.createReader(warpType);
2960
+ return reader.read(address);
2961
+ }
2962
+ createReader(type) {
2963
+ const readers = {
2964
+ native: () => new _native_token_js__WEBPACK_IMPORTED_MODULE_2__/* .AleoNativeTokenReader */ .b(this.aleoClient, this.onChainArtifactManagers),
2965
+ collateral: () => new _collateral_token_js__WEBPACK_IMPORTED_MODULE_1__/* .AleoCollateralTokenReader */ .P(this.aleoClient, this.onChainArtifactManagers),
2966
+ synthetic: () => new _synthetic_token_js__WEBPACK_IMPORTED_MODULE_3__/* .AleoSyntheticTokenReader */ .h(this.aleoClient, this.onChainArtifactManagers),
2967
+ crossCollateral: () => {
2968
+ throw new Error('Cross-collateral tokens are not supported on Aleo');
2969
+ },
2970
+ };
2971
+ return readers[type]();
2972
+ }
2973
+ createWriter(type, signer) {
2974
+ const writers = {
2975
+ native: () => new _native_token_js__WEBPACK_IMPORTED_MODULE_2__/* .AleoNativeTokenWriter */ .H(this.aleoClient, signer, this.onChainArtifactManagers),
2976
+ collateral: () => new _collateral_token_js__WEBPACK_IMPORTED_MODULE_1__/* .AleoCollateralTokenWriter */ .x(this.aleoClient, signer, this.onChainArtifactManagers),
2977
+ synthetic: () => new _synthetic_token_js__WEBPACK_IMPORTED_MODULE_3__/* .AleoSyntheticTokenWriter */ .l(this.aleoClient, signer, this.onChainArtifactManagers),
2978
+ crossCollateral: () => {
2979
+ throw new Error('Cross-collateral tokens are not supported on Aleo');
2980
+ },
2981
+ };
2982
+ return writers[type]();
2983
+ }
2984
+ }
2985
+ //# sourceMappingURL=warp-artifact-manager.js.map
2986
+ __webpack_async_result__();
2987
+ } catch(e) { __webpack_async_result__(e); } });
2988
+
2989
+ /***/ }),
2990
+
2991
+ /***/ 69661:
2992
+ /***/ ((__webpack_module__, __webpack_exports__, __webpack_require__) => {
2993
+
2994
+ __webpack_require__.a(__webpack_module__, async (__webpack_handle_async_dependencies__, __webpack_async_result__) => { try {
2995
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
2996
+ /* harmony export */ D1: () => (/* binding */ getAleoWarpTokenType),
2997
+ /* harmony export */ Lb: () => (/* binding */ getTokenMetadata),
2998
+ /* harmony export */ NV: () => (/* binding */ getCollateralWarpTokenConfig),
2999
+ /* harmony export */ nu: () => (/* binding */ getSyntheticWarpTokenConfig),
3000
+ /* harmony export */ rX: () => (/* binding */ getNativeWarpTokenConfig)
3001
+ /* harmony export */ });
3002
+ /* unused harmony exports localRemoteDecimalsToScale, nativeScaleExponentToMultiplier, TokenRegistryEntryNotFoundError, getRemoteRouters, resolveTokenMetadata */
3003
+ /* harmony import */ var _provablehq_sdk__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(83684);
3004
+ /* harmony import */ var _recoillink_utils__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(94523);
3005
+ /* harmony import */ var _recoillink_utils__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(73689);
3006
+ /* harmony import */ var _recoillink_utils__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(14918);
3007
+ /* harmony import */ var _recoillink_utils__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(21387);
3008
+ /* harmony import */ var _recoillink_utils__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(93142);
3009
+ /* harmony import */ var _utils_helper_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(15952);
3010
+ /* harmony import */ var _utils_helper_crypto_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(44996);
3011
+ /* harmony import */ var _utils_types_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(96602);
3012
+ /* harmony import */ var _provider_query_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(1874);
3013
+ var __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([_provablehq_sdk__WEBPACK_IMPORTED_MODULE_0__, _utils_helper_crypto_js__WEBPACK_IMPORTED_MODULE_2__]);
3014
+ ([_provablehq_sdk__WEBPACK_IMPORTED_MODULE_0__, _utils_helper_crypto_js__WEBPACK_IMPORTED_MODULE_2__] = __webpack_async_dependencies__.then ? (await __webpack_async_dependencies__)() : __webpack_async_dependencies__);
3015
+
3016
+
3017
+
3018
+
3019
+
3020
+
3021
+ const logger = _recoillink_utils__WEBPACK_IMPORTED_MODULE_5__/* .rootLogger */ .Jk.child({ module: 'aleo-warp-query' });
3022
+
3023
+ /**
3024
+ * Converts the v2 ARC-20 warp token standard's on-chain local_decimals/
3025
+ * remote_decimals fields into the scale multiplier convention used elsewhere
3026
+ * in the SDK (mirrors svm-sdk's remoteDecimalsToScale). Returns undefined for
3027
+ * identity scale (remote === local) or when either side is unavailable.
3028
+ */
3029
+ function localRemoteDecimalsToScale(localDecimals, remoteDecimals) {
3030
+ if ((0,_recoillink_utils__WEBPACK_IMPORTED_MODULE_6__/* .isNullish */ .u)(localDecimals) || (0,_recoillink_utils__WEBPACK_IMPORTED_MODULE_6__/* .isNullish */ .u)(remoteDecimals))
3031
+ return undefined;
3032
+ const diff = remoteDecimals - localDecimals;
3033
+ return diff === 0 ? undefined : Math.pow(10, diff);
3034
+ }
3035
+ /**
3036
+ * Converts hyp_native's on-chain `scale` field — a base-10 exponent (see
3037
+ * `pow 10u64 r0.scale` in the hyp_native program) — into the SDK's scale
3038
+ * multiplier convention used elsewhere (undefined for identity, i.e.
3039
+ * exponent 0).
3040
+ */
3041
+ function nativeScaleExponentToMultiplier(exponent) {
3042
+ if ((0,_recoillink_utils__WEBPACK_IMPORTED_MODULE_6__/* .isNullish */ .u)(exponent) || exponent === 0)
3043
+ return undefined;
3044
+ return Math.pow(10, exponent);
3045
+ }
3046
+ /**
3047
+ * Thrown when a `registered_tokens` read for a tokenId yields no value — either
3048
+ * the token was never registered (legacy v1 synthetics) or it was just
3049
+ * registered and has not finalized/indexed yet. Both cases look identical at
3050
+ * read time, so this stays recoverable: retryAsync retries it, and only after
3051
+ * the retries are exhausted does resolveTokenMetadata treat it as a genuine
3052
+ * miss and fall back. Any other error (RPC/transport, plaintext decode) is a
3053
+ * distinct failure that must propagate.
3054
+ */
3055
+ class TokenRegistryEntryNotFoundError extends Error {
3056
+ constructor(tokenId) {
3057
+ super(`Expected token metadata to be registered in token_registry.aleo but none found for tokenId: ${tokenId}`);
3058
+ this.name = 'TokenRegistryEntryNotFoundError';
3059
+ }
3060
+ }
3061
+ /**
3062
+ * Query token metadata from token_registry.aleo
3063
+ */
3064
+ async function getTokenMetadata(aleoClient, tokenId, retryAttempts = _utils_helper_js__WEBPACK_IMPORTED_MODULE_1__/* .RETRY_ATTEMPTS */ .Km, retryDelayMs = _utils_helper_js__WEBPACK_IMPORTED_MODULE_1__/* .RETRY_DELAY_MS */ .k) {
3065
+ // An empty read may be a genuine legacy miss or a just-registered mapping
3066
+ // that has not finalized/indexed yet, so retry the bounded budget before
3067
+ // giving up. After exhaustion retryAsync rethrows TokenRegistryEntryNotFound-
3068
+ // Error, which resolveTokenMetadata catches to fall back; transient RPC/
3069
+ // transport errors surface as plain (recoverable) errors and are retried too.
3070
+ const mappingValue = await (0,_recoillink_utils__WEBPACK_IMPORTED_MODULE_7__/* .retryAsync */ .tH)(async () => {
3071
+ const value = await aleoClient.getProgramMappingValue('token_registry.aleo', 'registered_tokens', tokenId);
3072
+ if ((0,_recoillink_utils__WEBPACK_IMPORTED_MODULE_6__/* .isNullish */ .u)(value) || value === '') {
3073
+ throw new TokenRegistryEntryNotFoundError(tokenId);
3074
+ }
3075
+ return value;
3076
+ }, retryAttempts, retryDelayMs);
3077
+ const tokenMetadata = _provablehq_sdk__WEBPACK_IMPORTED_MODULE_0__.Plaintext.fromString(mappingValue).toObject();
3078
+ return {
3079
+ name: (0,_utils_helper_js__WEBPACK_IMPORTED_MODULE_1__/* .U128ToString */ .vH)(tokenMetadata['name']),
3080
+ symbol: (0,_utils_helper_js__WEBPACK_IMPORTED_MODULE_1__/* .U128ToString */ .vH)(tokenMetadata['symbol']),
3081
+ decimals: tokenMetadata['decimals'],
3082
+ };
3083
+ }
3084
+ /**
3085
+ * Convert numeric token type to AleoTokenType enum
3086
+ */
3087
+ function toAleoTokenType(value) {
3088
+ switch (value) {
3089
+ case _utils_types_js__WEBPACK_IMPORTED_MODULE_3__/* .AleoTokenType */ .hq.NATIVE:
3090
+ return _utils_types_js__WEBPACK_IMPORTED_MODULE_3__/* .AleoTokenType */ .hq.NATIVE;
3091
+ case _utils_types_js__WEBPACK_IMPORTED_MODULE_3__/* .AleoTokenType */ .hq.SYNTHETIC:
3092
+ return _utils_types_js__WEBPACK_IMPORTED_MODULE_3__/* .AleoTokenType */ .hq.SYNTHETIC;
3093
+ case _utils_types_js__WEBPACK_IMPORTED_MODULE_3__/* .AleoTokenType */ .hq.COLLATERAL:
3094
+ return _utils_types_js__WEBPACK_IMPORTED_MODULE_3__/* .AleoTokenType */ .hq.COLLATERAL;
3095
+ default:
3096
+ throw new Error(`Expected valid token type for aleo contract but got ${value}`);
3097
+ }
3098
+ }
3099
+ /**
3100
+ * Detect the type of an Aleo warp token
3101
+ */
3102
+ async function getAleoWarpTokenType(aleoClient, tokenAddress) {
3103
+ const { programId } = (0,_utils_helper_js__WEBPACK_IMPORTED_MODULE_1__/* .fromAleoAddress */ .kz)(tokenAddress);
3104
+ // Wrap the read + assert together so a mapping that hasn't finalized/indexed
3105
+ // yet (e.g. immediately after deployment) is retried, not treated as absent.
3106
+ const metadataValue = await (0,_recoillink_utils__WEBPACK_IMPORTED_MODULE_7__/* .retryAsync */ .tH)(async () => {
3107
+ const value = await aleoClient.getProgramMappingValue(programId, 'app_metadata', 'true');
3108
+ (0,_recoillink_utils__WEBPACK_IMPORTED_MODULE_8__/* .assert */ .v)(value, `Expected app_metadata mapping to exist for token ${tokenAddress} but none found`);
3109
+ return value;
3110
+ }, _utils_helper_js__WEBPACK_IMPORTED_MODULE_1__/* .RETRY_ATTEMPTS */ .Km, _utils_helper_js__WEBPACK_IMPORTED_MODULE_1__/* .RETRY_DELAY_MS */ .k);
3111
+ const metadata = _provablehq_sdk__WEBPACK_IMPORTED_MODULE_0__.Plaintext.fromString(metadataValue).toObject();
3112
+ const tokenTypeValue = metadata['token_type'];
3113
+ (0,_recoillink_utils__WEBPACK_IMPORTED_MODULE_8__/* .assert */ .v)(typeof tokenTypeValue === 'number', `Expected token_type field to be a number in app_metadata for token ${tokenAddress} but got ${typeof tokenTypeValue}`);
3114
+ return toAleoTokenType(tokenTypeValue);
3115
+ }
3116
+ /**
3117
+ * Query remote router configurations for a warp token
3118
+ */
3119
+ async function getRemoteRouters(aleoClient, tokenAddress) {
3120
+ return _provider_query_js__WEBPACK_IMPORTED_MODULE_4__/* .getRemoteRouters */ .ZY({ Plaintext: _provablehq_sdk__WEBPACK_IMPORTED_MODULE_0__.Plaintext }, aleoClient, tokenAddress);
3121
+ }
3122
+ async function getWarpTokenMetadata(aleoClient, tokenAddress) {
3123
+ const { programId } = (0,_utils_helper_js__WEBPACK_IMPORTED_MODULE_1__/* .fromAleoAddress */ .kz)(tokenAddress);
3124
+ // Wrap the read + assert together so a mapping that hasn't finalized/indexed
3125
+ // yet (e.g. immediately after deployment) is retried, not treated as absent.
3126
+ const metadataValue = await (0,_recoillink_utils__WEBPACK_IMPORTED_MODULE_7__/* .retryAsync */ .tH)(async () => {
3127
+ const value = await aleoClient.getProgramMappingValue(programId, 'app_metadata', 'true');
3128
+ (0,_recoillink_utils__WEBPACK_IMPORTED_MODULE_8__/* .assert */ .v)(value, `Expected app_metadata mapping to exist for token ${tokenAddress} but none found`);
3129
+ return value;
3130
+ }, _utils_helper_js__WEBPACK_IMPORTED_MODULE_1__/* .RETRY_ATTEMPTS */ .Km, _utils_helper_js__WEBPACK_IMPORTED_MODULE_1__/* .RETRY_DELAY_MS */ .k);
3131
+ const metadata = _provablehq_sdk__WEBPACK_IMPORTED_MODULE_0__.Plaintext.fromString(metadataValue).toObject();
3132
+ const tokenType = metadata['token_type'];
3133
+ const tokenOwner = metadata['token_owner'];
3134
+ const ism = metadata['ism'];
3135
+ const hook = metadata['hook'];
3136
+ const tokenId = metadata['token_id'];
3137
+ const localDecimals = metadata['local_decimals'];
3138
+ const remoteDecimals = metadata['remote_decimals'];
3139
+ const scale = metadata['scale'];
3140
+ (0,_recoillink_utils__WEBPACK_IMPORTED_MODULE_8__/* .assert */ .v)(typeof tokenType === 'number', `Expected token_type field to be a number in app_metadata for token ${tokenAddress} but got ${typeof tokenType}`);
3141
+ (0,_recoillink_utils__WEBPACK_IMPORTED_MODULE_8__/* .assert */ .v)(typeof tokenOwner === 'string', `Expected token_owner field to be a string in app_metadata for token ${tokenAddress} but got ${typeof tokenOwner}`);
3142
+ (0,_recoillink_utils__WEBPACK_IMPORTED_MODULE_8__/* .assert */ .v)(typeof ism === 'string', `Expected ism field to be a string in app_metadata for token ${tokenAddress} but got ${typeof ism}`);
3143
+ (0,_recoillink_utils__WEBPACK_IMPORTED_MODULE_8__/* .assert */ .v)(typeof hook === 'string', `Expected hook field to be a string in app_metadata for token ${tokenAddress} but got ${typeof hook}`);
3144
+ (0,_recoillink_utils__WEBPACK_IMPORTED_MODULE_8__/* .assert */ .v)((0,_recoillink_utils__WEBPACK_IMPORTED_MODULE_6__/* .isNullish */ .u)(tokenId) || typeof tokenId === 'string', `Expected token_id field to be a string in app_metadata for token ${tokenAddress} but got ${typeof tokenId}`);
3145
+ (0,_recoillink_utils__WEBPACK_IMPORTED_MODULE_8__/* .assert */ .v)((0,_recoillink_utils__WEBPACK_IMPORTED_MODULE_6__/* .isNullish */ .u)(localDecimals) || typeof localDecimals === 'number', `Expected local_decimals field to be a number in app_metadata for token ${tokenAddress} but got ${typeof localDecimals}`);
3146
+ (0,_recoillink_utils__WEBPACK_IMPORTED_MODULE_8__/* .assert */ .v)((0,_recoillink_utils__WEBPACK_IMPORTED_MODULE_6__/* .isNullish */ .u)(remoteDecimals) || typeof remoteDecimals === 'number', `Expected remote_decimals field to be a number in app_metadata for token ${tokenAddress} but got ${typeof remoteDecimals}`);
3147
+ (0,_recoillink_utils__WEBPACK_IMPORTED_MODULE_8__/* .assert */ .v)((0,_recoillink_utils__WEBPACK_IMPORTED_MODULE_6__/* .isNullish */ .u)(scale) || typeof scale === 'number', `Expected scale field to be a number in app_metadata for token ${tokenAddress} but got ${typeof scale}`);
3148
+ return {
3149
+ token_type: tokenType,
3150
+ token_owner: tokenOwner,
3151
+ ism,
3152
+ hook,
3153
+ token_id: tokenId,
3154
+ local_decimals: localDecimals,
3155
+ remote_decimals: remoteDecimals,
3156
+ scale,
3157
+ };
3158
+ }
3159
+ /**
3160
+ * Get mailbox address for a warp token
3161
+ */
3162
+ async function getMailboxAddress(aleoClient, tokenAddress) {
3163
+ const { programId } = (0,_utils_helper_js__WEBPACK_IMPORTED_MODULE_1__/* .fromAleoAddress */ .kz)(tokenAddress);
3164
+ const imports = await aleoClient.getProgramImportNames(programId);
3165
+ const mailboxProgramId = imports.find((i) => i.includes('mailbox'));
3166
+ const ismManagerProgramId = imports.find((i) => i.includes('ism_manager'));
3167
+ const hookManagerProgramId = imports.find((i) => i.includes('hook_manager'));
3168
+ (0,_recoillink_utils__WEBPACK_IMPORTED_MODULE_8__/* .assert */ .v)(mailboxProgramId, `Expected mailbox program in imports for token ${tokenAddress} but none found`);
3169
+ return {
3170
+ mailboxAddress: (0,_utils_helper_crypto_js__WEBPACK_IMPORTED_MODULE_2__/* .toAleoAddress */ .j2)(mailboxProgramId),
3171
+ ismManagerProgramId,
3172
+ hookManagerProgramId,
3173
+ };
3174
+ }
3175
+ /**
3176
+ * Parse ISM address from metadata
3177
+ */
3178
+ function formatIsmAddress(ismAddress, ismManager) {
3179
+ if ((0,_recoillink_utils__WEBPACK_IMPORTED_MODULE_9__/* .isZeroishAddress */ .Hi)(ismAddress)) {
3180
+ return undefined;
3181
+ }
3182
+ return `${ismManager}/${ismAddress}`;
3183
+ }
3184
+ /**
3185
+ * Parse Hook address from metadata
3186
+ */
3187
+ function formatHookAddress(hookAddress, hookManager) {
3188
+ if ((0,_recoillink_utils__WEBPACK_IMPORTED_MODULE_9__/* .isZeroishAddress */ .Hi)(hookAddress)) {
3189
+ return undefined;
3190
+ }
3191
+ return `${hookManager}/${hookAddress}`;
3192
+ }
3193
+ /**
3194
+ * Query native warp token configuration
3195
+ */
3196
+ async function getNativeWarpTokenConfig(aleoClient, tokenAddress, fallbackIsmManager, fallbackHookManager) {
3197
+ // Query metadata
3198
+ const metadata = await getWarpTokenMetadata(aleoClient, tokenAddress);
3199
+ // Verify token type
3200
+ const tokenTypeValue = metadata.token_type;
3201
+ const tokenType = toAleoTokenType(tokenTypeValue);
3202
+ (0,_recoillink_utils__WEBPACK_IMPORTED_MODULE_8__/* .assert */ .v)(tokenType === _utils_types_js__WEBPACK_IMPORTED_MODULE_3__/* .AleoTokenType */ .hq.NATIVE, `Expected native token (type ${_utils_types_js__WEBPACK_IMPORTED_MODULE_3__/* .AleoTokenType */ .hq.NATIVE}) at ${tokenAddress} but got type ${tokenType}`);
3203
+ // Get mailbox
3204
+ const { mailboxAddress, ismManagerProgramId, hookManagerProgramId } = await getMailboxAddress(aleoClient, tokenAddress);
3205
+ // Parse ISM
3206
+ const ism = formatIsmAddress(metadata.ism, ismManagerProgramId || fallbackIsmManager);
3207
+ const hook = formatHookAddress(metadata.hook, hookManagerProgramId || fallbackHookManager);
3208
+ // Get remote routers
3209
+ const remoteRouters = await getRemoteRouters(aleoClient, tokenAddress);
3210
+ const scale = nativeScaleExponentToMultiplier(metadata.scale);
3211
+ return {
3212
+ type: _utils_types_js__WEBPACK_IMPORTED_MODULE_3__/* .AleoTokenType */ .hq.NATIVE,
3213
+ owner: metadata.token_owner,
3214
+ mailbox: mailboxAddress,
3215
+ ism,
3216
+ hook,
3217
+ remoteRouters,
3218
+ scale,
3219
+ };
3220
+ }
3221
+ /**
3222
+ * Resolve token name/symbol/decimals for a warp token — ARC-20 for v2, token_registry for v1.
3223
+ *
3224
+ * name/symbol/decimals live in the ARC-20 token program (v2) or token_registry.aleo (v1).
3225
+ * v1 tokens that were never registered in token_registry.aleo (e.g. legacy synthetics) make
3226
+ * that lookup throw after its bounded retries are exhausted, but decimals are also carried
3227
+ * authoritatively in app_metadata.local_decimals and name/symbol are not compared by
3228
+ * check-warp-deploy, so a registry miss is non-fatal: fall back to local_decimals for decimals
3229
+ * and empty strings for name/symbol.
3230
+ */
3231
+ async function resolveTokenMetadata(aleoClient, programId, tokenId, localDecimals, retryAttempts = _utils_helper_js__WEBPACK_IMPORTED_MODULE_1__/* .RETRY_ATTEMPTS */ .Km, retryDelayMs = _utils_helper_js__WEBPACK_IMPORTED_MODULE_1__/* .RETRY_DELAY_MS */ .k) {
3232
+ // v2 ARC-20 tokens carry authoritative name/symbol/decimals in their token
3233
+ // program; any failure reading it is a real error and must propagate.
3234
+ if ((0,_utils_helper_js__WEBPACK_IMPORTED_MODULE_1__/* .isV2WarpToken */ .O8)(programId)) {
3235
+ const arc20ProgramId = await _provider_query_js__WEBPACK_IMPORTED_MODULE_4__/* .getArc20ProgramId */ .cT(aleoClient, programId);
3236
+ return _provider_query_js__WEBPACK_IMPORTED_MODULE_4__/* .getArc20TokenMetadata */ .$h(aleoClient, arc20ProgramId);
3237
+ }
3238
+ // v1 tokens read name/symbol/decimals from token_registry.aleo. Legacy
3239
+ // synthetics were never registered there, so a registry miss that persists
3240
+ // across the bounded retries is non-fatal (decimals are also in
3241
+ // app_metadata.local_decimals; name/symbol aren't compared by
3242
+ // check-warp-deploy). Any OTHER failure — RPC/transport, plaintext decode —
3243
+ // is a real error and must propagate.
3244
+ let registryMetadata;
3245
+ try {
3246
+ registryMetadata = await getTokenMetadata(aleoClient, tokenId, retryAttempts, retryDelayMs);
3247
+ }
3248
+ catch (error) {
3249
+ if (!(error instanceof TokenRegistryEntryNotFoundError)) {
3250
+ throw error;
3251
+ }
3252
+ logger.warn({ programId, tokenId, err: error }, 'token_registry.aleo has no entry for this v1 token; falling back to app_metadata.local_decimals for decimals and empty name/symbol');
3253
+ }
3254
+ const decimals = registryMetadata?.decimals ?? localDecimals;
3255
+ (0,_recoillink_utils__WEBPACK_IMPORTED_MODULE_8__/* .assert */ .v)(decimals != null, `Unable to resolve decimals for token ${programId} (tokenId ${tokenId}): token registry lookup failed and app_metadata.local_decimals is missing`);
3256
+ return {
3257
+ name: registryMetadata?.name ?? '',
3258
+ symbol: registryMetadata?.symbol ?? '',
3259
+ decimals,
3260
+ };
3261
+ }
3262
+ /**
3263
+ * Query collateral warp token configuration
3264
+ */
3265
+ async function getCollateralWarpTokenConfig(aleoClient, tokenAddress, fallbackIsmManager, fallbackHookManager) {
3266
+ const { programId } = (0,_utils_helper_js__WEBPACK_IMPORTED_MODULE_1__/* .fromAleoAddress */ .kz)(tokenAddress);
3267
+ // Query metadata
3268
+ const metadata = await getWarpTokenMetadata(aleoClient, tokenAddress);
3269
+ // Verify token type
3270
+ const tokenTypeValue = metadata.token_type;
3271
+ const tokenType = toAleoTokenType(tokenTypeValue);
3272
+ (0,_recoillink_utils__WEBPACK_IMPORTED_MODULE_8__/* .assert */ .v)(tokenType === _utils_types_js__WEBPACK_IMPORTED_MODULE_3__/* .AleoTokenType */ .hq.COLLATERAL, `Expected collateral token (type ${_utils_types_js__WEBPACK_IMPORTED_MODULE_3__/* .AleoTokenType */ .hq.COLLATERAL}) at ${tokenAddress} but got type ${tokenType}`);
3273
+ // Get mailbox
3274
+ const { mailboxAddress, ismManagerProgramId, hookManagerProgramId } = await getMailboxAddress(aleoClient, tokenAddress);
3275
+ // Parse ISM
3276
+ const ism = formatIsmAddress(metadata.ism, ismManagerProgramId || fallbackIsmManager);
3277
+ const hook = formatHookAddress(metadata.hook, hookManagerProgramId || fallbackHookManager);
3278
+ // Get remote routers
3279
+ const remoteRouters = await getRemoteRouters(aleoClient, tokenAddress);
3280
+ // Get token ID and metadata — ARC-20 for v2, token_registry for v1
3281
+ const tokenId = metadata.token_id;
3282
+ (0,_recoillink_utils__WEBPACK_IMPORTED_MODULE_8__/* .assert */ .v)(tokenId, `Expected token_id field in app_metadata for token ${tokenAddress} but none found`);
3283
+ const { name, symbol, decimals } = await resolveTokenMetadata(aleoClient, programId, tokenId, metadata.local_decimals);
3284
+ const scale = localRemoteDecimalsToScale(metadata.local_decimals, metadata.remote_decimals);
3285
+ return {
3286
+ type: _utils_types_js__WEBPACK_IMPORTED_MODULE_3__/* .AleoTokenType */ .hq.COLLATERAL,
3287
+ owner: metadata.token_owner,
3288
+ mailbox: mailboxAddress,
3289
+ ism,
3290
+ hook,
3291
+ remoteRouters,
3292
+ token: tokenId,
3293
+ name,
3294
+ symbol,
3295
+ decimals,
3296
+ scale,
3297
+ };
3298
+ }
3299
+ /**
3300
+ * Query synthetic warp token configuration
3301
+ */
3302
+ async function getSyntheticWarpTokenConfig(aleoClient, tokenAddress, fallbackIsmManager, fallbackHookManager) {
3303
+ const { programId } = (0,_utils_helper_js__WEBPACK_IMPORTED_MODULE_1__/* .fromAleoAddress */ .kz)(tokenAddress);
3304
+ // Query metadata
3305
+ const metadata = await getWarpTokenMetadata(aleoClient, tokenAddress);
3306
+ // Verify token type
3307
+ const tokenTypeValue = metadata.token_type;
3308
+ const tokenType = toAleoTokenType(tokenTypeValue);
3309
+ (0,_recoillink_utils__WEBPACK_IMPORTED_MODULE_8__/* .assert */ .v)(tokenType === _utils_types_js__WEBPACK_IMPORTED_MODULE_3__/* .AleoTokenType */ .hq.SYNTHETIC, `Expected synthetic token (type ${_utils_types_js__WEBPACK_IMPORTED_MODULE_3__/* .AleoTokenType */ .hq.SYNTHETIC}) at ${tokenAddress} but got type ${tokenType}`);
3310
+ // Get mailbox
3311
+ const { mailboxAddress, ismManagerProgramId, hookManagerProgramId } = await getMailboxAddress(aleoClient, tokenAddress);
3312
+ // Parse ISM
3313
+ const ism = formatIsmAddress(metadata.ism, ismManagerProgramId || fallbackIsmManager);
3314
+ const hook = formatHookAddress(metadata.hook, hookManagerProgramId || fallbackHookManager);
3315
+ // Get remote routers
3316
+ const remoteRouters = await getRemoteRouters(aleoClient, tokenAddress);
3317
+ // Get token metadata — ARC-20 for v2, token_registry for v1
3318
+ const tokenId = metadata.token_id;
3319
+ (0,_recoillink_utils__WEBPACK_IMPORTED_MODULE_8__/* .assert */ .v)(tokenId, `Expected token_id field in app_metadata for token ${tokenAddress} but none found`);
3320
+ const { name, symbol, decimals } = await resolveTokenMetadata(aleoClient, programId, tokenId, metadata.local_decimals);
3321
+ const scale = localRemoteDecimalsToScale(metadata.local_decimals, metadata.remote_decimals);
3322
+ return {
3323
+ type: _utils_types_js__WEBPACK_IMPORTED_MODULE_3__/* .AleoTokenType */ .hq.SYNTHETIC,
3324
+ owner: metadata.token_owner,
3325
+ mailbox: mailboxAddress,
3326
+ ism,
3327
+ hook,
3328
+ remoteRouters,
3329
+ name,
3330
+ symbol,
3331
+ decimals,
3332
+ scale,
3333
+ };
3334
+ }
3335
+ //# sourceMappingURL=warp-query.js.map
3336
+ __webpack_async_result__();
3337
+ } catch(e) { __webpack_async_result__(e); } });
3338
+
3339
+ /***/ }),
3340
+
3341
+ /***/ 29197:
3342
+ /***/ ((__webpack_module__, __webpack_exports__, __webpack_require__) => {
3343
+
3344
+ __webpack_require__.a(__webpack_module__, async (__webpack_handle_async_dependencies__, __webpack_async_result__) => { try {
3345
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
3346
+ /* harmony export */ RN: () => (/* binding */ getCreateCollateralTokenTx),
3347
+ /* harmony export */ UL: () => (/* binding */ getPostDeploymentUpdateTxs),
3348
+ /* harmony export */ cf: () => (/* binding */ getWarpTokenUpdateTxs),
3349
+ /* harmony export */ ln: () => (/* binding */ getCreateSyntheticTokenTx),
3350
+ /* harmony export */ uB: () => (/* binding */ scaleToRemoteDecimals),
3351
+ /* harmony export */ zf: () => (/* binding */ getCreateNativeTokenTx)
3352
+ /* harmony export */ });
3353
+ /* unused harmony exports getSetTokenOwnerTx, getSetTokenIsmTx, getSetTokenHookTx, getEnrollRemoteRouterTx, getUnenrollRemoteRouterTx */
3354
+ /* harmony import */ var _recoillink_provider_sdk_warp__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(17791);
3355
+ /* harmony import */ var _recoillink_utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(21387);
3356
+ /* harmony import */ var _recoillink_utils__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(73689);
3357
+ /* harmony import */ var _recoillink_utils__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(93142);
3358
+ /* harmony import */ var _utils_helper_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(15952);
3359
+ /* harmony import */ var _warp_query_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(69661);
3360
+ var __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([_warp_query_js__WEBPACK_IMPORTED_MODULE_2__]);
3361
+ _warp_query_js__WEBPACK_IMPORTED_MODULE_2__ = (__webpack_async_dependencies__.then ? (await __webpack_async_dependencies__)() : __webpack_async_dependencies__)[0];
3362
+
3363
+
3364
+
3365
+
3366
+ function withErrorContext(context, error) {
3367
+ const message = error instanceof Error ? error.message : String(error);
3368
+ return new Error(`${context}: ${message}`);
3369
+ }
3370
+ /**
3371
+ * Create transaction for initializing a native token
3372
+ */
3373
+ function getCreateNativeTokenTx(tokenProgramId) {
3374
+ return {
3375
+ programName: tokenProgramId,
3376
+ functionName: 'init',
3377
+ priorityFee: 0,
3378
+ privateFee: false,
3379
+ inputs: [(0,_utils_helper_js__WEBPACK_IMPORTED_MODULE_1__/* .programIdToPlaintext */ .Ox)(tokenProgramId), `0u8`],
3380
+ };
3381
+ }
3382
+ /**
3383
+ * Create transaction for initializing a collateral token
3384
+ */
3385
+ async function getCreateCollateralTokenTx(aleoClient, tokenProgramId, collateralDenom) {
3386
+ const metadata = await (0,_warp_query_js__WEBPACK_IMPORTED_MODULE_2__/* .getTokenMetadata */ .Lb)(aleoClient, collateralDenom).catch((error) => {
3387
+ throw withErrorContext(`Failed to query collateral token metadata (tokenProgramId=${tokenProgramId}, collateralDenom=${collateralDenom})`, error);
3388
+ });
3389
+ return {
3390
+ programName: tokenProgramId,
3391
+ functionName: 'init',
3392
+ priorityFee: 0,
3393
+ privateFee: false,
3394
+ inputs: [
3395
+ (0,_utils_helper_js__WEBPACK_IMPORTED_MODULE_1__/* .programIdToPlaintext */ .Ox)(tokenProgramId),
3396
+ collateralDenom,
3397
+ `${metadata.decimals}u8`,
3398
+ ],
3399
+ };
3400
+ }
3401
+ /**
3402
+ * Create transaction for initializing a synthetic token
3403
+ */
3404
+ function getCreateSyntheticTokenTx(tokenProgramId, name, denom, decimals, remoteDecimals = decimals) {
3405
+ return {
3406
+ programName: tokenProgramId,
3407
+ functionName: 'init',
3408
+ priorityFee: 0,
3409
+ privateFee: false,
3410
+ inputs: [
3411
+ (0,_utils_helper_js__WEBPACK_IMPORTED_MODULE_1__/* .programIdToPlaintext */ .Ox)(tokenProgramId),
3412
+ `${(0,_utils_helper_js__WEBPACK_IMPORTED_MODULE_1__/* .stringToU128 */ .hu)(name).toString()}u128`,
3413
+ `${(0,_utils_helper_js__WEBPACK_IMPORTED_MODULE_1__/* .stringToU128 */ .hu)(denom).toString()}u128`,
3414
+ `${decimals}u8`,
3415
+ `${remoteDecimals}u8`,
3416
+ ],
3417
+ };
3418
+ }
3419
+ /** Derives Aleo's remote decimals from the configured power-of-ten scale. */
3420
+ function scaleToRemoteDecimals(localDecimals, scale = 1) {
3421
+ const exponent = Math.round(Math.log10(scale));
3422
+ (0,_recoillink_utils__WEBPACK_IMPORTED_MODULE_3__/* .assert */ .v)(Number.isFinite(scale) && scale > 0 && Number(`1e${exponent}`) === scale, `scale must be a positive power of 10, got ${scale}`);
3423
+ (0,_recoillink_utils__WEBPACK_IMPORTED_MODULE_3__/* .assert */ .v)(Math.abs(exponent) <= 18, 'Aleo local and remote decimals must differ by at most 18');
3424
+ const remoteDecimals = localDecimals + exponent;
3425
+ (0,_recoillink_utils__WEBPACK_IMPORTED_MODULE_3__/* .assert */ .v)(Number.isInteger(localDecimals) &&
3426
+ localDecimals >= 0 &&
3427
+ localDecimals <= 255 &&
3428
+ remoteDecimals >= 0 &&
3429
+ remoteDecimals <= 255, `Aleo local and remote decimals must be integers in [0, 255], got ${localDecimals} and ${remoteDecimals}`);
3430
+ return remoteDecimals;
3431
+ }
3432
+ /**
3433
+ * Create transaction for setting token owner
3434
+ */
3435
+ function getSetTokenOwnerTx(tokenAddress, newOwner) {
3436
+ return {
3437
+ programName: (0,_utils_helper_js__WEBPACK_IMPORTED_MODULE_1__/* .fromAleoAddress */ .kz)(tokenAddress).programId,
3438
+ functionName: 'set_owner',
3439
+ priorityFee: 0,
3440
+ privateFee: false,
3441
+ inputs: [newOwner],
3442
+ };
3443
+ }
3444
+ /**
3445
+ * Create transaction for setting token ISM
3446
+ */
3447
+ function getSetTokenIsmTx(tokenAddress, ismAddress) {
3448
+ // Handle zero address - use Aleo null address to unset ISM
3449
+ const ism = !(0,_recoillink_utils__WEBPACK_IMPORTED_MODULE_4__/* .isNullish */ .u)(ismAddress) && !(0,_recoillink_utils__WEBPACK_IMPORTED_MODULE_5__/* .isZeroishAddress */ .Hi)(ismAddress)
3450
+ ? (0,_utils_helper_js__WEBPACK_IMPORTED_MODULE_1__/* .fromAleoAddress */ .kz)(ismAddress).address
3451
+ : _utils_helper_js__WEBPACK_IMPORTED_MODULE_1__/* .ALEO_NULL_ADDRESS */ .B$;
3452
+ return {
3453
+ programName: (0,_utils_helper_js__WEBPACK_IMPORTED_MODULE_1__/* .fromAleoAddress */ .kz)(tokenAddress).programId,
3454
+ functionName: 'set_custom_ism',
3455
+ priorityFee: 0,
3456
+ privateFee: false,
3457
+ inputs: [ism],
3458
+ };
3459
+ }
3460
+ /**
3461
+ * Create transaction for setting token hook
3462
+ */
3463
+ function getSetTokenHookTx(tokenAddress, hookAddress) {
3464
+ const hook = !(0,_recoillink_utils__WEBPACK_IMPORTED_MODULE_4__/* .isNullish */ .u)(hookAddress) && !(0,_recoillink_utils__WEBPACK_IMPORTED_MODULE_5__/* .isZeroishAddress */ .Hi)(hookAddress)
3465
+ ? (0,_utils_helper_js__WEBPACK_IMPORTED_MODULE_1__/* .fromAleoAddress */ .kz)(hookAddress).address
3466
+ : _utils_helper_js__WEBPACK_IMPORTED_MODULE_1__/* .ALEO_NULL_ADDRESS */ .B$;
3467
+ return {
3468
+ programName: (0,_utils_helper_js__WEBPACK_IMPORTED_MODULE_1__/* .fromAleoAddress */ .kz)(tokenAddress).programId,
3469
+ functionName: 'set_custom_hook',
3470
+ priorityFee: 0,
3471
+ privateFee: false,
3472
+ inputs: [hook],
3473
+ };
3474
+ }
3475
+ /**
3476
+ * Create transaction for enrolling a remote router
3477
+ */
3478
+ function getEnrollRemoteRouterTx(tokenAddress, domainId, routerAddress, gas) {
3479
+ const bytes = (0,_utils_helper_js__WEBPACK_IMPORTED_MODULE_1__/* .fillArray */ .R2)([...Buffer.from((0,_recoillink_utils__WEBPACK_IMPORTED_MODULE_5__/* .strip0x */ .LL)(routerAddress), 'hex')].map((b) => `${b}u8`), 32, `0u8`);
3480
+ return {
3481
+ programName: (0,_utils_helper_js__WEBPACK_IMPORTED_MODULE_1__/* .fromAleoAddress */ .kz)(tokenAddress).programId,
3482
+ functionName: 'enroll_remote_router',
3483
+ priorityFee: 0,
3484
+ privateFee: false,
3485
+ inputs: [`${domainId}u32`, (0,_utils_helper_js__WEBPACK_IMPORTED_MODULE_1__/* .arrayToPlaintext */ .Sr)(bytes), `${gas}u128`],
3486
+ };
3487
+ }
3488
+ /**
3489
+ * Create transaction for unenrolling a remote router
3490
+ */
3491
+ function getUnenrollRemoteRouterTx(tokenAddress, domainId) {
3492
+ return {
3493
+ programName: (0,_utils_helper_js__WEBPACK_IMPORTED_MODULE_1__/* .fromAleoAddress */ .kz)(tokenAddress).programId,
3494
+ functionName: 'unroll_remote_router',
3495
+ priorityFee: 0,
3496
+ privateFee: false,
3497
+ inputs: [`${domainId}u32`],
3498
+ };
3499
+ }
3500
+ /**
3501
+ * Generate post-deployment transactions for ISM setup and router enrollment.
3502
+ * Used after token deployment to configure ISM and enroll remote routers.
3503
+ *
3504
+ * @param tokenAddress The deployed token address
3505
+ * @param config The warp token configuration
3506
+ * @returns Array of transactions to execute in order
3507
+ */
3508
+ function getPostDeploymentUpdateTxs(tokenAddress, config) {
3509
+ const txs = [];
3510
+ // Set ISM if configured
3511
+ if (config.interchainSecurityModule) {
3512
+ const setIsmTx = getSetTokenIsmTx(tokenAddress, config.interchainSecurityModule.deployed.address);
3513
+ txs.push(setIsmTx);
3514
+ }
3515
+ // Set Hook if configured
3516
+ if (config.hook) {
3517
+ const setHookTx = getSetTokenHookTx(tokenAddress, config.hook.deployed.address);
3518
+ txs.push(setHookTx);
3519
+ }
3520
+ const routerDiff = (0,_recoillink_provider_sdk_warp__WEBPACK_IMPORTED_MODULE_0__/* .computeRemoteRoutersUpdates */ .aq)({ destinationGas: {}, remoteRouters: {} }, config, _recoillink_utils__WEBPACK_IMPORTED_MODULE_5__/* .eqAddressAleo */ .qI);
3521
+ // Enroll remote routers
3522
+ for (const { domainId, routerAddress, gas } of routerDiff.toEnroll) {
3523
+ const enrollTx = getEnrollRemoteRouterTx(tokenAddress, domainId, routerAddress, gas);
3524
+ txs.push(enrollTx);
3525
+ }
3526
+ // We don't transfer ownership here because after deployment the token needs to be
3527
+ // enrolled with the other tokens deployed and only the owner can do that
3528
+ return txs;
3529
+ }
3530
+ /**
3531
+ * Generates update transactions for a warp token by comparing current on-chain state
3532
+ * with desired configuration. Returns transactions for ISM updates, router enrollment/unenrollment,
3533
+ * and ownership transfer (always last).
3534
+ *
3535
+ * @param expectedArtifactState The desired warp token configuration with deployment address
3536
+ * @param currentArtifactState The current on-chain warp token state
3537
+ * @returns Array of transactions to execute in order
3538
+ */
3539
+ function getWarpTokenUpdateTxs(expectedArtifactState, currentArtifactState) {
3540
+ const { config: expectedConfig, deployed } = expectedArtifactState;
3541
+ const { config: currentConfig } = currentArtifactState;
3542
+ const updateTxs = [];
3543
+ // Update ISM if changed
3544
+ const currentIsm = currentConfig.interchainSecurityModule?.deployed.address;
3545
+ const newIsm = expectedConfig.interchainSecurityModule?.deployed.address;
3546
+ if (!(0,_recoillink_utils__WEBPACK_IMPORTED_MODULE_5__/* .eqOptionalAddress */ .le)(currentIsm, newIsm, _recoillink_utils__WEBPACK_IMPORTED_MODULE_5__/* .eqAddressAleo */ .qI)) {
3547
+ const setIsmTx = getSetTokenIsmTx(deployed.address, newIsm);
3548
+ updateTxs.push({
3549
+ annotation: 'Updating token ISM',
3550
+ ...setIsmTx,
3551
+ });
3552
+ }
3553
+ // Update hook if changed
3554
+ const currentHook = currentConfig.hook?.deployed.address;
3555
+ const newHook = expectedConfig.hook?.deployed.address;
3556
+ if (!(0,_recoillink_utils__WEBPACK_IMPORTED_MODULE_5__/* .eqOptionalAddress */ .le)(currentHook, newHook, _recoillink_utils__WEBPACK_IMPORTED_MODULE_5__/* .eqAddressAleo */ .qI)) {
3557
+ const setHookTx = getSetTokenHookTx(deployed.address, newHook);
3558
+ updateTxs.push({
3559
+ annotation: 'Updating token Hook',
3560
+ ...setHookTx,
3561
+ });
3562
+ }
3563
+ const routerDiff = (0,_recoillink_provider_sdk_warp__WEBPACK_IMPORTED_MODULE_0__/* .computeRemoteRoutersUpdates */ .aq)(currentConfig, expectedConfig, _recoillink_utils__WEBPACK_IMPORTED_MODULE_5__/* .eqAddressAleo */ .qI);
3564
+ // Unenroll removed routers
3565
+ for (const domainId of routerDiff.toUnenroll) {
3566
+ const unenrollTx = getUnenrollRemoteRouterTx(deployed.address, domainId);
3567
+ updateTxs.push({
3568
+ annotation: `Unenrolling router for domain ${domainId}`,
3569
+ ...unenrollTx,
3570
+ });
3571
+ }
3572
+ // Enroll or update routers
3573
+ for (const { domainId, routerAddress, gas } of routerDiff.toEnroll) {
3574
+ const enrollTx = getEnrollRemoteRouterTx(deployed.address, domainId, routerAddress, gas);
3575
+ updateTxs.push({
3576
+ annotation: `Enrolling/updating router for domain ${domainId}`,
3577
+ ...enrollTx,
3578
+ });
3579
+ }
3580
+ // Owner transfer must be last transaction as the current owner executes all updates
3581
+ if (!(0,_recoillink_utils__WEBPACK_IMPORTED_MODULE_5__/* .eqAddressAleo */ .qI)(currentConfig.owner, expectedConfig.owner)) {
3582
+ const setOwnerTx = getSetTokenOwnerTx(deployed.address, expectedConfig.owner);
3583
+ updateTxs.push({
3584
+ annotation: 'Setting new token owner',
3585
+ ...setOwnerTx,
3586
+ });
3587
+ }
3588
+ return updateTxs;
3589
+ }
3590
+ //# sourceMappingURL=warp-tx.js.map
3591
+ __webpack_async_result__();
3592
+ } catch(e) { __webpack_async_result__(e); } });
3593
+
3594
+ /***/ })
3595
+
3596
+ };