@aztec/aztec.js 0.0.0-test.1 → 0.0.1-commit.5476d83
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.
- package/README.md +1 -1
- package/dest/account/account.d.ts +59 -0
- package/dest/account/account.d.ts.map +1 -0
- package/dest/account/account.js +59 -0
- package/dest/account/account_contract.d.ts +43 -0
- package/dest/account/account_contract.d.ts.map +1 -0
- package/dest/account/{contract.js → account_contract.js} +7 -4
- package/dest/account/account_with_secret_key.d.ts +24 -0
- package/dest/account/account_with_secret_key.d.ts.map +1 -0
- package/dest/{wallet/account_wallet_with_private_key.js → account/account_with_secret_key.js} +5 -5
- package/dest/account/index.d.ts +4 -8
- package/dest/account/index.d.ts.map +1 -1
- package/dest/account/index.js +2 -6
- package/dest/account/interface.d.ts +2 -14
- package/dest/account/interface.d.ts.map +1 -1
- package/dest/account/interface.js +1 -0
- package/dest/account/signerless_account.d.ts +23 -0
- package/dest/account/signerless_account.d.ts.map +1 -0
- package/dest/account/signerless_account.js +27 -0
- package/dest/api/abi.d.ts +3 -2
- package/dest/api/abi.d.ts.map +1 -1
- package/dest/api/abi.js +1 -1
- package/dest/api/account.d.ts +7 -3
- package/dest/api/account.d.ts.map +1 -1
- package/dest/api/account.js +4 -1
- package/dest/api/addresses.d.ts +2 -1
- package/dest/api/addresses.d.ts.map +1 -1
- package/dest/api/addresses.js +1 -0
- package/dest/api/authorization.d.ts +5 -0
- package/dest/api/authorization.d.ts.map +1 -0
- package/dest/api/authorization.js +4 -0
- package/dest/api/block.d.ts +3 -0
- package/dest/api/block.d.ts.map +1 -0
- package/dest/api/block.js +2 -0
- package/dest/api/contract.d.ts +49 -0
- package/dest/api/contract.d.ts.map +1 -0
- package/dest/{contract/index.js → api/contract.js} +15 -11
- package/dest/api/crypto.d.ts +2 -0
- package/dest/api/crypto.d.ts.map +1 -0
- package/dest/api/crypto.js +1 -0
- package/dest/api/deployment.d.ts +5 -4
- package/dest/api/deployment.d.ts.map +1 -1
- package/dest/api/deployment.js +4 -3
- package/dest/api/eth_address.d.ts +1 -1
- package/dest/api/ethereum.d.ts +2 -0
- package/dest/api/ethereum.d.ts.map +1 -0
- package/dest/api/ethereum.js +1 -0
- package/dest/api/events.d.ts +12 -0
- package/dest/api/events.d.ts.map +1 -0
- package/dest/api/events.js +30 -0
- package/dest/api/fee.d.ts +2 -2
- package/dest/api/fee.d.ts.map +1 -1
- package/dest/api/fee.js +1 -1
- package/dest/api/fee_testing.d.ts +2 -0
- package/dest/api/fee_testing.d.ts.map +1 -0
- package/dest/api/fee_testing.js +1 -0
- package/dest/api/fields.d.ts +1 -1
- package/dest/api/keys.d.ts +4 -0
- package/dest/api/keys.d.ts.map +1 -0
- package/dest/api/keys.js +3 -0
- package/dest/api/log.d.ts +2 -1
- package/dest/api/log.d.ts.map +1 -1
- package/dest/api/log.js +1 -0
- package/dest/api/messaging.d.ts +3 -0
- package/dest/api/messaging.d.ts.map +1 -0
- package/dest/api/messaging.js +2 -0
- package/dest/api/node.d.ts +21 -0
- package/dest/api/node.d.ts.map +1 -0
- package/dest/api/node.js +18 -0
- package/dest/api/note.d.ts +2 -0
- package/dest/api/note.d.ts.map +1 -0
- package/dest/api/note.js +1 -0
- package/dest/api/protocol.d.ts +3 -0
- package/dest/api/protocol.d.ts.map +1 -0
- package/dest/api/protocol.js +2 -0
- package/dest/api/trees.d.ts +3 -0
- package/dest/api/trees.d.ts.map +1 -0
- package/dest/api/trees.js +2 -0
- package/dest/api/tx.d.ts +2 -0
- package/dest/api/tx.d.ts.map +1 -0
- package/dest/api/tx.js +1 -0
- package/dest/api/utils.d.ts +13 -0
- package/dest/api/utils.d.ts.map +1 -0
- package/dest/api/utils.js +12 -0
- package/dest/api/wallet.d.ts +4 -2
- package/dest/api/wallet.d.ts.map +1 -1
- package/dest/api/wallet.js +3 -1
- package/dest/authorization/call_authorization_request.d.ts +46 -0
- package/dest/authorization/call_authorization_request.d.ts.map +1 -0
- package/dest/authorization/call_authorization_request.js +49 -0
- package/dest/contract/base_contract_interaction.d.ts +16 -80
- package/dest/contract/base_contract_interaction.d.ts.map +1 -1
- package/dest/contract/base_contract_interaction.js +15 -128
- package/dest/contract/batch_call.d.ts +19 -21
- package/dest/contract/batch_call.d.ts.map +1 -1
- package/dest/contract/batch_call.js +86 -68
- package/dest/contract/checker.d.ts +2 -2
- package/dest/contract/checker.d.ts.map +1 -1
- package/dest/contract/checker.js +2 -2
- package/dest/contract/contract.d.ts +9 -8
- package/dest/contract/contract.d.ts.map +1 -1
- package/dest/contract/contract.js +10 -20
- package/dest/contract/contract_base.d.ts +7 -20
- package/dest/contract/contract_base.d.ts.map +1 -1
- package/dest/contract/contract_base.js +7 -14
- package/dest/contract/contract_function_interaction.d.ts +53 -45
- package/dest/contract/contract_function_interaction.d.ts.map +1 -1
- package/dest/contract/contract_function_interaction.js +78 -74
- package/dest/contract/deploy_method.d.ts +106 -60
- package/dest/contract/deploy_method.d.ts.map +1 -1
- package/dest/contract/deploy_method.js +125 -133
- package/dest/contract/deploy_sent_tx.d.ts +14 -11
- package/dest/contract/deploy_sent_tx.d.ts.map +1 -1
- package/dest/contract/deploy_sent_tx.js +18 -15
- package/dest/contract/get_gas_limits.d.ts +6 -7
- package/dest/contract/get_gas_limits.d.ts.map +1 -1
- package/dest/contract/get_gas_limits.js +9 -3
- package/dest/contract/interaction_options.d.ts +114 -0
- package/dest/contract/interaction_options.d.ts.map +1 -0
- package/dest/contract/interaction_options.js +46 -0
- package/dest/contract/protocol_contracts.d.ts +7 -7
- package/dest/contract/protocol_contracts.d.ts.map +1 -1
- package/dest/contract/protocol_contracts.js +7 -7
- package/dest/contract/sent_tx.d.ts +9 -19
- package/dest/contract/sent_tx.d.ts.map +1 -1
- package/dest/contract/sent_tx.js +31 -43
- package/dest/contract/unsafe_contract.d.ts +2 -2
- package/dest/contract/unsafe_contract.d.ts.map +1 -1
- package/dest/contract/unsafe_contract.js +1 -1
- package/dest/contract/wait_for_proven.d.ts +17 -0
- package/dest/contract/wait_for_proven.d.ts.map +1 -0
- package/dest/contract/wait_for_proven.js +17 -0
- package/dest/deployment/broadcast_function.d.ts +4 -4
- package/dest/deployment/broadcast_function.d.ts.map +1 -1
- package/dest/deployment/broadcast_function.js +27 -23
- package/dest/deployment/contract_deployer.d.ts +2 -2
- package/dest/deployment/contract_deployer.d.ts.map +1 -1
- package/dest/deployment/contract_deployer.js +1 -1
- package/dest/deployment/publish_class.d.ts +6 -0
- package/dest/deployment/publish_class.d.ts.map +1 -0
- package/dest/deployment/publish_class.js +17 -0
- package/dest/deployment/publish_instance.d.ts +10 -0
- package/dest/deployment/publish_instance.d.ts.map +1 -0
- package/dest/deployment/publish_instance.js +11 -0
- package/dest/ethereum/portal_manager.d.ts +138 -0
- package/dest/ethereum/portal_manager.d.ts.map +1 -0
- package/dest/{api/ethereum → ethereum}/portal_manager.js +136 -76
- package/dest/fee/fee_juice_payment_method_with_claim.d.ts +17 -12
- package/dest/fee/fee_juice_payment_method_with_claim.d.ts.map +1 -1
- package/dest/fee/fee_juice_payment_method_with_claim.js +26 -16
- package/dest/fee/fee_payment_method.d.ts +12 -8
- package/dest/fee/fee_payment_method.d.ts.map +1 -1
- package/dest/fee/private_fee_payment_method.d.ts +26 -9
- package/dest/fee/private_fee_payment_method.d.ts.map +1 -1
- package/dest/fee/private_fee_payment_method.js +44 -22
- package/dest/fee/public_fee_payment_method.d.ts +27 -10
- package/dest/fee/public_fee_payment_method.d.ts.map +1 -1
- package/dest/fee/public_fee_payment_method.js +46 -24
- package/dest/fee/sponsored_fee_payment.d.ts +17 -0
- package/dest/fee/sponsored_fee_payment.d.ts.map +1 -0
- package/dest/fee/sponsored_fee_payment.js +34 -0
- package/dest/utils/abi_types.d.ts +1 -3
- package/dest/utils/abi_types.d.ts.map +1 -1
- package/dest/utils/authwit.d.ts +82 -25
- package/dest/utils/authwit.d.ts.map +1 -1
- package/dest/utils/authwit.js +237 -40
- package/dest/utils/cross_chain.d.ts +24 -0
- package/dest/utils/cross_chain.d.ts.map +1 -0
- package/dest/utils/cross_chain.js +30 -0
- package/dest/utils/fee_juice.d.ts +4 -3
- package/dest/utils/fee_juice.d.ts.map +1 -1
- package/dest/utils/fee_juice.js +3 -2
- package/dest/utils/field_compressed_string.d.ts +1 -1
- package/dest/utils/field_compressed_string.d.ts.map +1 -1
- package/dest/utils/node.d.ts +2 -2
- package/dest/utils/node.d.ts.map +1 -1
- package/dest/utils/node.js +1 -1
- package/dest/utils/pub_key.d.ts +1 -1
- package/dest/utils/pub_key.d.ts.map +1 -1
- package/dest/utils/pub_key.js +1 -2
- package/dest/wallet/account_entrypoint_meta_payment_method.d.ts +34 -0
- package/dest/wallet/account_entrypoint_meta_payment_method.d.ts.map +1 -0
- package/dest/wallet/account_entrypoint_meta_payment_method.js +76 -0
- package/dest/wallet/account_manager.d.ts +66 -0
- package/dest/wallet/account_manager.d.ts.map +1 -0
- package/dest/wallet/account_manager.js +113 -0
- package/dest/wallet/deploy_account_method.d.ts +52 -0
- package/dest/wallet/deploy_account_method.d.ts.map +1 -0
- package/dest/wallet/deploy_account_method.js +77 -0
- package/dest/wallet/index.d.ts +3 -17
- package/dest/wallet/index.d.ts.map +1 -1
- package/dest/wallet/index.js +2 -20
- package/dest/wallet/wallet.d.ts +1965 -0
- package/dest/wallet/wallet.d.ts.map +1 -0
- package/dest/wallet/wallet.js +186 -0
- package/package.json +44 -35
- package/src/account/account.ts +96 -0
- package/src/account/{contract.ts → account_contract.ts} +24 -13
- package/src/{wallet/account_wallet_with_private_key.ts → account/account_with_secret_key.ts} +6 -8
- package/src/account/index.ts +3 -7
- package/src/account/interface.ts +1 -12
- package/src/account/signerless_account.ts +45 -0
- package/src/api/abi.ts +26 -0
- package/src/api/account.ts +6 -9
- package/src/api/addresses.ts +1 -0
- package/src/api/authorization.ts +14 -0
- package/src/api/block.ts +2 -0
- package/src/{contract/index.ts → api/contract.ts} +39 -14
- package/src/api/crypto.ts +1 -0
- package/src/api/deployment.ts +4 -3
- package/src/api/ethereum.ts +10 -0
- package/src/api/events.ts +44 -0
- package/src/api/fee.ts +1 -1
- package/src/api/fee_testing.ts +1 -0
- package/src/api/keys.ts +8 -0
- package/src/api/log.ts +1 -0
- package/src/api/messaging.ts +2 -0
- package/src/api/node.ts +20 -0
- package/src/api/note.ts +1 -0
- package/src/api/protocol.ts +2 -0
- package/src/api/trees.ts +2 -0
- package/src/api/tx.ts +13 -0
- package/src/api/utils.ts +14 -0
- package/src/api/wallet.ts +27 -5
- package/src/authorization/call_authorization_request.ts +63 -0
- package/src/contract/base_contract_interaction.ts +23 -166
- package/src/contract/batch_call.ts +106 -57
- package/src/contract/checker.ts +8 -3
- package/src/contract/contract.ts +14 -21
- package/src/contract/contract_base.ts +9 -26
- package/src/contract/contract_function_interaction.ts +135 -106
- package/src/contract/deploy_method.ts +205 -134
- package/src/contract/deploy_sent_tx.ts +24 -23
- package/src/contract/get_gas_limits.ts +15 -8
- package/src/contract/interaction_options.ts +163 -0
- package/src/contract/protocol_contracts.ts +10 -10
- package/src/contract/sent_tx.ts +41 -52
- package/src/contract/unsafe_contract.ts +2 -2
- package/src/contract/wait_for_proven.ts +38 -0
- package/src/deployment/broadcast_function.ts +57 -57
- package/src/deployment/contract_deployer.ts +4 -3
- package/src/deployment/publish_class.ts +34 -0
- package/src/deployment/publish_instance.ts +26 -0
- package/src/{api/ethereum → ethereum}/portal_manager.ts +164 -83
- package/src/fee/fee_juice_payment_method_with_claim.ts +48 -33
- package/src/fee/fee_payment_method.ts +11 -7
- package/src/fee/private_fee_payment_method.ts +79 -57
- package/src/fee/public_fee_payment_method.ts +93 -67
- package/src/fee/sponsored_fee_payment.ts +46 -0
- package/src/utils/authwit.ts +261 -53
- package/src/utils/cross_chain.ts +53 -0
- package/src/utils/fee_juice.ts +4 -4
- package/src/utils/node.ts +1 -1
- package/src/utils/pub_key.ts +1 -2
- package/src/wallet/account_entrypoint_meta_payment_method.ts +106 -0
- package/src/wallet/account_manager.ts +154 -0
- package/src/wallet/deploy_account_method.ts +126 -0
- package/src/wallet/index.ts +2 -33
- package/src/wallet/wallet.ts +318 -0
- package/dest/account/contract.d.ts +0 -37
- package/dest/account/contract.d.ts.map +0 -1
- package/dest/account/wallet.d.ts +0 -11
- package/dest/account/wallet.d.ts.map +0 -1
- package/dest/account/wallet.js +0 -3
- package/dest/account_manager/deploy_account_method.d.ts +0 -15
- package/dest/account_manager/deploy_account_method.d.ts.map +0 -1
- package/dest/account_manager/deploy_account_method.js +0 -43
- package/dest/account_manager/deploy_account_sent_tx.d.ts +0 -30
- package/dest/account_manager/deploy_account_sent_tx.d.ts.map +0 -1
- package/dest/account_manager/deploy_account_sent_tx.js +0 -29
- package/dest/account_manager/index.d.ts +0 -108
- package/dest/account_manager/index.d.ts.map +0 -1
- package/dest/account_manager/index.js +0 -159
- package/dest/api/cheat_codes.d.ts +0 -26
- package/dest/api/cheat_codes.d.ts.map +0 -1
- package/dest/api/cheat_codes.js +0 -25
- package/dest/api/entrypoint.d.ts +0 -2
- package/dest/api/entrypoint.d.ts.map +0 -1
- package/dest/api/entrypoint.js +0 -1
- package/dest/api/ethereum/anvil_test_watcher.d.ts +0 -32
- package/dest/api/ethereum/anvil_test_watcher.d.ts.map +0 -1
- package/dest/api/ethereum/anvil_test_watcher.js +0 -133
- package/dest/api/ethereum/chain_monitor.d.ts +0 -25
- package/dest/api/ethereum/chain_monitor.d.ts.map +0 -1
- package/dest/api/ethereum/chain_monitor.js +0 -74
- package/dest/api/ethereum/cheat_codes.d.ts +0 -63
- package/dest/api/ethereum/cheat_codes.d.ts.map +0 -1
- package/dest/api/ethereum/cheat_codes.js +0 -162
- package/dest/api/ethereum/index.d.ts +0 -7
- package/dest/api/ethereum/index.d.ts.map +0 -1
- package/dest/api/ethereum/index.js +0 -6
- package/dest/api/ethereum/l1_contracts.d.ts +0 -3
- package/dest/api/ethereum/l1_contracts.d.ts.map +0 -1
- package/dest/api/ethereum/l1_contracts.js +0 -13
- package/dest/api/ethereum/portal_manager.d.ts +0 -136
- package/dest/api/ethereum/portal_manager.d.ts.map +0 -1
- package/dest/api/interfaces/pxe.d.ts +0 -2
- package/dest/api/interfaces/pxe.d.ts.map +0 -1
- package/dest/api/interfaces/pxe.js +0 -1
- package/dest/api/log_id.d.ts +0 -2
- package/dest/api/log_id.d.ts.map +0 -1
- package/dest/api/log_id.js +0 -1
- package/dest/api/tx_hash.d.ts +0 -2
- package/dest/api/tx_hash.d.ts.map +0 -1
- package/dest/api/tx_hash.js +0 -1
- package/dest/contract/deploy_proven_tx.d.ts +0 -21
- package/dest/contract/deploy_proven_tx.d.ts.map +0 -1
- package/dest/contract/deploy_proven_tx.js +0 -19
- package/dest/contract/index.d.ts +0 -45
- package/dest/contract/index.d.ts.map +0 -1
- package/dest/contract/proven_tx.d.ts +0 -17
- package/dest/contract/proven_tx.d.ts.map +0 -1
- package/dest/contract/proven_tx.js +0 -22
- package/dest/deployment/deploy_instance.d.ts +0 -10
- package/dest/deployment/deploy_instance.d.ts.map +0 -1
- package/dest/deployment/deploy_instance.js +0 -14
- package/dest/deployment/index.d.ts +0 -2
- package/dest/deployment/index.d.ts.map +0 -1
- package/dest/deployment/index.js +0 -1
- package/dest/deployment/register_class.d.ts +0 -6
- package/dest/deployment/register_class.d.ts.map +0 -1
- package/dest/deployment/register_class.js +0 -22
- package/dest/entrypoint/default_entrypoint.d.ts +0 -12
- package/dest/entrypoint/default_entrypoint.d.ts.map +0 -1
- package/dest/entrypoint/default_entrypoint.js +0 -28
- package/dest/entrypoint/default_multi_call_entrypoint.d.ts +0 -15
- package/dest/entrypoint/default_multi_call_entrypoint.d.ts.map +0 -1
- package/dest/entrypoint/default_multi_call_entrypoint.js +0 -130
- package/dest/entrypoint/entrypoint.d.ts +0 -35
- package/dest/entrypoint/entrypoint.d.ts.map +0 -1
- package/dest/entrypoint/entrypoint.js +0 -4
- package/dest/entrypoint/payload.d.ts +0 -128
- package/dest/entrypoint/payload.d.ts.map +0 -1
- package/dest/entrypoint/payload.js +0 -143
- package/dest/fee/fee_juice_payment_method.d.ts +0 -14
- package/dest/fee/fee_juice_payment_method.d.ts.map +0 -1
- package/dest/fee/fee_juice_payment_method.js +0 -20
- package/dest/index.d.ts +0 -66
- package/dest/index.d.ts.map +0 -1
- package/dest/index.js +0 -69
- package/dest/rpc_clients/index.d.ts +0 -3
- package/dest/rpc_clients/index.d.ts.map +0 -1
- package/dest/rpc_clients/index.js +0 -2
- package/dest/rpc_clients/node/index.d.ts +0 -12
- package/dest/rpc_clients/node/index.d.ts.map +0 -1
- package/dest/rpc_clients/node/index.js +0 -78
- package/dest/rpc_clients/pxe_client.d.ts +0 -10
- package/dest/rpc_clients/pxe_client.d.ts.map +0 -1
- package/dest/rpc_clients/pxe_client.js +0 -23
- package/dest/utils/aztec_cheatcodes.d.ts +0 -59
- package/dest/utils/aztec_cheatcodes.d.ts.map +0 -1
- package/dest/utils/aztec_cheatcodes.js +0 -62
- package/dest/utils/index.d.ts +0 -8
- package/dest/utils/index.d.ts.map +0 -1
- package/dest/utils/index.js +0 -6
- package/dest/utils/pxe.d.ts +0 -4
- package/dest/utils/pxe.d.ts.map +0 -1
- package/dest/utils/pxe.js +0 -14
- package/dest/wallet/account_wallet.d.ts +0 -76
- package/dest/wallet/account_wallet.d.ts.map +0 -1
- package/dest/wallet/account_wallet.js +0 -231
- package/dest/wallet/account_wallet_with_private_key.d.ts +0 -26
- package/dest/wallet/account_wallet_with_private_key.d.ts.map +0 -1
- package/dest/wallet/base_wallet.d.ts +0 -73
- package/dest/wallet/base_wallet.d.ts.map +0 -1
- package/dest/wallet/base_wallet.js +0 -123
- package/dest/wallet/signerless_wallet.d.ts +0 -25
- package/dest/wallet/signerless_wallet.d.ts.map +0 -1
- package/dest/wallet/signerless_wallet.js +0 -36
- package/src/account/wallet.ts +0 -13
- package/src/account_manager/deploy_account_method.ts +0 -86
- package/src/account_manager/deploy_account_sent_tx.ts +0 -42
- package/src/account_manager/index.ts +0 -229
- package/src/api/cheat_codes.ts +0 -35
- package/src/api/entrypoint.ts +0 -1
- package/src/api/ethereum/anvil_test_watcher.ts +0 -158
- package/src/api/ethereum/chain_monitor.ts +0 -88
- package/src/api/ethereum/cheat_codes.ts +0 -184
- package/src/api/ethereum/index.ts +0 -19
- package/src/api/ethereum/l1_contracts.ts +0 -21
- package/src/api/interfaces/pxe.ts +0 -1
- package/src/api/log_id.ts +0 -1
- package/src/api/tx_hash.ts +0 -1
- package/src/contract/deploy_proven_tx.ts +0 -34
- package/src/contract/proven_tx.ts +0 -42
- package/src/deployment/deploy_instance.ts +0 -31
- package/src/deployment/index.ts +0 -1
- package/src/deployment/register_class.ts +0 -44
- package/src/entrypoint/default_entrypoint.ts +0 -39
- package/src/entrypoint/default_multi_call_entrypoint.ts +0 -93
- package/src/entrypoint/entrypoint.ts +0 -39
- package/src/entrypoint/payload.ts +0 -238
- package/src/fee/fee_juice_payment_method.ts +0 -26
- package/src/index.ts +0 -106
- package/src/rpc_clients/index.ts +0 -2
- package/src/rpc_clients/node/index.ts +0 -77
- package/src/rpc_clients/pxe_client.ts +0 -25
- package/src/utils/aztec_cheatcodes.ts +0 -77
- package/src/utils/index.ts +0 -21
- package/src/utils/pxe.ts +0 -17
- package/src/wallet/account_wallet.ts +0 -242
- package/src/wallet/base_wallet.ts +0 -198
- package/src/wallet/signerless_wallet.ts +0 -52
|
@@ -1,113 +1,159 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { Fr } from '@aztec/foundation/fields';
|
|
2
2
|
import { type ContractArtifact, type FunctionArtifact } from '@aztec/stdlib/abi';
|
|
3
|
+
import type { AuthWitness } from '@aztec/stdlib/auth-witness';
|
|
3
4
|
import { AztecAddress } from '@aztec/stdlib/aztec-address';
|
|
4
5
|
import { type ContractInstanceWithAddress } from '@aztec/stdlib/contract';
|
|
5
|
-
import type { GasSettings } from '@aztec/stdlib/gas';
|
|
6
6
|
import type { PublicKeys } from '@aztec/stdlib/keys';
|
|
7
|
-
import type
|
|
8
|
-
import
|
|
9
|
-
import type {
|
|
10
|
-
import { BaseContractInteraction
|
|
11
|
-
import type { Contract } from './contract.js';
|
|
7
|
+
import { type Capsule, type TxProfileResult } from '@aztec/stdlib/tx';
|
|
8
|
+
import { ExecutionPayload } from '@aztec/stdlib/tx';
|
|
9
|
+
import type { Wallet } from '../wallet/wallet.js';
|
|
10
|
+
import { BaseContractInteraction } from './base_contract_interaction.js';
|
|
12
11
|
import type { ContractBase } from './contract_base.js';
|
|
13
|
-
import { DeployProvenTx } from './deploy_proven_tx.js';
|
|
14
12
|
import { DeploySentTx } from './deploy_sent_tx.js';
|
|
13
|
+
import { type ProfileInteractionOptions, type RequestInteractionOptions, type SendInteractionOptions, type SimulationInteractionFeeOptions, type SimulationReturn } from './interaction_options.js';
|
|
15
14
|
/**
|
|
16
15
|
* Options for deploying a contract on the Aztec network.
|
|
17
|
-
* Allows specifying a contract address salt
|
|
16
|
+
* Allows specifying a contract address salt and different options to tweak contract publication
|
|
17
|
+
* and initialization
|
|
18
18
|
*/
|
|
19
|
-
export type
|
|
19
|
+
export type RequestDeployOptions = RequestInteractionOptions & {
|
|
20
20
|
/** An optional salt value used to deterministically calculate the contract address. */
|
|
21
21
|
contractAddressSalt?: Fr;
|
|
22
|
-
/**
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
22
|
+
/**
|
|
23
|
+
* Deployer address that will be used for the deployed contract's address computation.
|
|
24
|
+
* If set to 0, the sender's address won't be mixed in
|
|
25
|
+
*/
|
|
26
|
+
deployer?: AztecAddress;
|
|
27
|
+
/** Skip contract class publication. */
|
|
28
|
+
skipClassPublication?: boolean;
|
|
29
|
+
/** Skip publication, instead just privately initialize the contract. */
|
|
30
|
+
skipInstancePublication?: boolean;
|
|
28
31
|
/** Skip contract initialization. */
|
|
29
32
|
skipInitialization?: boolean;
|
|
30
|
-
|
|
33
|
+
/** Skip contract registration in the wallet */
|
|
34
|
+
skipRegistration?: boolean;
|
|
35
|
+
};
|
|
36
|
+
/**
|
|
37
|
+
* Extends the deployment options with the required parameters to send the transaction
|
|
38
|
+
*/
|
|
39
|
+
export type DeployOptions = Omit<RequestDeployOptions, 'deployer'> & {
|
|
40
|
+
/**
|
|
41
|
+
* Set to true to *not* include the sender in the address computation. This option
|
|
42
|
+
* is mutually exclusive with "deployer"
|
|
43
|
+
*/
|
|
44
|
+
universalDeploy?: boolean;
|
|
45
|
+
} & Pick<SendInteractionOptions, 'from' | 'fee'>;
|
|
46
|
+
/**
|
|
47
|
+
* Options for simulating the deployment of a contract
|
|
48
|
+
* Allows skipping certain validations and computing gas estimations
|
|
49
|
+
*/
|
|
50
|
+
export type SimulateDeployOptions = Omit<DeployOptions, 'fee'> & {
|
|
51
|
+
/** The fee options for the transaction. */
|
|
52
|
+
fee?: SimulationInteractionFeeOptions;
|
|
53
|
+
/** Simulate without checking for the validity of the resulting transaction,
|
|
54
|
+
* e.g. whether it emits any existing nullifiers. */
|
|
55
|
+
skipTxValidation?: boolean;
|
|
56
|
+
/** Whether to ensure the fee payer is not empty and has enough balance to pay for the fee. */
|
|
57
|
+
skipFeeEnforcement?: boolean;
|
|
58
|
+
/** Whether to include metadata such as offchain effects and performance statistics
|
|
59
|
+
* (e.g. timing information of the different circuits and oracles) in
|
|
60
|
+
* the simulation result, instead of just the return value of the function */
|
|
61
|
+
includeMetadata?: boolean;
|
|
62
|
+
};
|
|
31
63
|
/**
|
|
32
|
-
* Contract interaction for deployment.
|
|
33
|
-
* and initialization of the contract.
|
|
64
|
+
* Contract interaction for deployment.
|
|
65
|
+
* Handles class publication, instance publication, and initialization of the contract.
|
|
66
|
+
*
|
|
67
|
+
* Note that for some contracts, a tx is not required as part of its "creation":
|
|
68
|
+
* If there are no public functions, and if there are no initialization functions,
|
|
69
|
+
* then technically the contract has already been "created", and all of the contract's
|
|
70
|
+
* functions (private and utility) can be interacted-with immediately, without any
|
|
71
|
+
* "deployment tx".
|
|
72
|
+
*
|
|
73
|
+
* Extends the BaseContractInteraction class.
|
|
34
74
|
*/
|
|
35
|
-
export declare class DeployMethod<TContract extends ContractBase =
|
|
75
|
+
export declare class DeployMethod<TContract extends ContractBase = ContractBase> extends BaseContractInteraction {
|
|
36
76
|
private publicKeys;
|
|
37
|
-
|
|
38
|
-
|
|
77
|
+
protected artifact: ContractArtifact;
|
|
78
|
+
protected postDeployCtor: (instance: ContractInstanceWithAddress, wallet: Wallet) => TContract;
|
|
39
79
|
private args;
|
|
40
80
|
/** The contract instance to be deployed. */
|
|
41
81
|
private instance?;
|
|
42
82
|
/** Constructor function to call. */
|
|
43
83
|
private constructorArtifact;
|
|
44
|
-
constructor(publicKeys: PublicKeys, wallet: Wallet, artifact: ContractArtifact, postDeployCtor: (
|
|
84
|
+
constructor(publicKeys: PublicKeys, wallet: Wallet, artifact: ContractArtifact, postDeployCtor: (instance: ContractInstanceWithAddress, wallet: Wallet) => TContract, args?: any[], constructorNameOrArtifact?: string | FunctionArtifact, authWitnesses?: AuthWitness[], capsules?: Capsule[]);
|
|
45
85
|
/**
|
|
46
|
-
*
|
|
47
|
-
*
|
|
48
|
-
*
|
|
49
|
-
* later sent using the `send()` method.
|
|
50
|
-
*
|
|
51
|
-
* @param options - An object containing optional deployment settings, contractAddressSalt, and from.
|
|
52
|
-
* @returns A Promise resolving to an object containing the signed transaction data and other relevant information.
|
|
86
|
+
* Returns the execution payload that allows this operation to happen on chain.
|
|
87
|
+
* @param options - Configuration options.
|
|
88
|
+
* @returns The execution payload for this operation
|
|
53
89
|
*/
|
|
54
|
-
|
|
90
|
+
request(options?: RequestDeployOptions): Promise<ExecutionPayload>;
|
|
91
|
+
convertDeployOptionsToRequestOptions(options: DeployOptions): RequestDeployOptions;
|
|
55
92
|
/**
|
|
56
|
-
*
|
|
57
|
-
* block for constructing batch requests.
|
|
93
|
+
* Adds this contract to the wallet and returns the Contract object.
|
|
58
94
|
* @param options - Deployment options.
|
|
59
|
-
* @returns An array of function calls.
|
|
60
|
-
* @remarks This method does not have the same return type as the `request` in the ContractInteraction object,
|
|
61
|
-
* it returns a promise for an array instead of a function call directly.
|
|
62
95
|
*/
|
|
63
|
-
|
|
96
|
+
register(options?: RequestDeployOptions): Promise<TContract>;
|
|
64
97
|
/**
|
|
65
|
-
*
|
|
66
|
-
*
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
*
|
|
71
|
-
* @param options - Deployment options.
|
|
72
|
-
* @returns A function call array with potentially requests to the class registerer and instance deployer.
|
|
98
|
+
* Returns an execution payload for:
|
|
99
|
+
* - publication of the contract class and
|
|
100
|
+
* - publication of the contract instance to enable public execution
|
|
101
|
+
* depending on the provided options.
|
|
102
|
+
* @param options - Contract creation options.
|
|
103
|
+
* @returns An execution payload with potentially calls (and bytecode capsule) to the class registry and instance registry.
|
|
73
104
|
*/
|
|
74
|
-
protected
|
|
105
|
+
protected getPublicationExecutionPayload(options?: RequestDeployOptions): Promise<ExecutionPayload>;
|
|
75
106
|
/**
|
|
76
107
|
* Returns the calls necessary to initialize the contract.
|
|
77
108
|
* @param options - Deployment options.
|
|
78
109
|
* @returns - An array of function calls.
|
|
79
110
|
*/
|
|
80
|
-
protected
|
|
111
|
+
protected getInitializationExecutionPayload(options?: RequestDeployOptions): Promise<ExecutionPayload>;
|
|
81
112
|
/**
|
|
82
|
-
* Send
|
|
113
|
+
* Send a contract deployment transaction (initialize and/or publish) using the provided options.
|
|
83
114
|
* This function extends the 'send' method from the ContractFunctionInteraction class,
|
|
84
115
|
* allowing us to send a transaction specifically for contract deployment.
|
|
85
116
|
*
|
|
86
117
|
* @param options - An object containing various deployment options such as contractAddressSalt and from.
|
|
87
118
|
* @returns A SentTx object that returns the receipt and the deployed contract instance.
|
|
88
119
|
*/
|
|
89
|
-
send(options
|
|
120
|
+
send(options: DeployOptions): DeploySentTx<TContract>;
|
|
90
121
|
/**
|
|
91
|
-
* Builds the contract instance
|
|
122
|
+
* Builds the contract instance and returns it.
|
|
92
123
|
*
|
|
93
|
-
* @param options - An object containing various
|
|
124
|
+
* @param options - An object containing various initialization and publication options.
|
|
94
125
|
* @returns An instance object.
|
|
95
126
|
*/
|
|
96
|
-
getInstance(options?:
|
|
127
|
+
getInstance(options?: RequestDeployOptions): Promise<ContractInstanceWithAddress>;
|
|
97
128
|
/**
|
|
98
|
-
*
|
|
99
|
-
*
|
|
100
|
-
* @
|
|
129
|
+
* Simulate the deployment
|
|
130
|
+
*
|
|
131
|
+
* @param options - An optional object containing additional configuration for the simulation.
|
|
132
|
+
* @returns A simulation result object containing metadata of the execution, including gas
|
|
133
|
+
* estimations (if requested via options), execution statistics and emitted offchain effects
|
|
101
134
|
*/
|
|
102
|
-
|
|
135
|
+
simulate(options: SimulateDeployOptions): Promise<SimulationReturn<true>>;
|
|
103
136
|
/**
|
|
104
|
-
*
|
|
105
|
-
* @param options -
|
|
137
|
+
* Simulate a deployment and profile the gate count for each function in the transaction.
|
|
138
|
+
* @param options - Same options as `send`, plus extra profiling options.
|
|
139
|
+
*
|
|
140
|
+
* @returns An object containing the function return value and profile result.
|
|
106
141
|
*/
|
|
107
|
-
|
|
142
|
+
profile(options: DeployOptions & ProfileInteractionOptions): Promise<TxProfileResult>;
|
|
108
143
|
/** Return this deployment address. */
|
|
109
144
|
get address(): AztecAddress | undefined;
|
|
110
145
|
/** Returns the partial address for this deployment. */
|
|
111
146
|
get partialAddress(): Promise<Fr> | undefined;
|
|
147
|
+
/**
|
|
148
|
+
* Augments this DeployMethod with additional metadata, such as authWitnesses and capsules.
|
|
149
|
+
* @param options - An object containing the metadata to add to the interaction
|
|
150
|
+
* @returns A new DeployMethod with the added metadata, but calling the same original function in the same manner
|
|
151
|
+
*/
|
|
152
|
+
with({ authWitnesses, capsules }: {
|
|
153
|
+
/** The authWitnesses to add to the deployment */
|
|
154
|
+
authWitnesses?: AuthWitness[];
|
|
155
|
+
/** The capsules to add to the deployment */
|
|
156
|
+
capsules?: Capsule[];
|
|
157
|
+
}): DeployMethod;
|
|
112
158
|
}
|
|
113
|
-
//# sourceMappingURL=
|
|
159
|
+
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UUFDRCxpREFBaUQ7UUFDakQsYUFBYSxDQUFDLEVBQUUsV0FBVyxFQUFFLENBQUM7UUFDOUIsNENBQTRDO1FBQzVDLFFBQVEsQ0FBQyxFQUFFLE9BQU8sRUFBRSxDQUFDO0tBQ3RCLEdBQUcsWUFBWSxDQVdmO0NBQ0YifQ==
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deploy_method.d.ts","sourceRoot":"","sources":["../../src/contract/deploy_method.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"deploy_method.d.ts","sourceRoot":"","sources":["../../src/contract/deploy_method.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAE,MAAM,0BAA0B,CAAC;AAC9C,OAAO,EAAE,KAAK,gBAAgB,EAAoB,KAAK,gBAAgB,EAAkB,MAAM,mBAAmB,CAAC;AACnH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAC9D,OAAO,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAC3D,OAAO,EACL,KAAK,2BAA2B,EAIjC,MAAM,wBAAwB,CAAC;AAChC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAE,KAAK,OAAO,EAAE,KAAK,eAAe,EAA0B,MAAM,kBAAkB,CAAC;AAC9F,OAAO,EAAE,gBAAgB,EAA0B,MAAM,kBAAkB,CAAC;AAI5E,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAClD,OAAO,EAAE,uBAAuB,EAAE,MAAM,gCAAgC,CAAC;AACzE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAEvD,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAEnD,OAAO,EACL,KAAK,yBAAyB,EAC9B,KAAK,yBAAyB,EAC9B,KAAK,sBAAsB,EAC3B,KAAK,+BAA+B,EACpC,KAAK,gBA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E,aAAa,GAAG,yBAAyB,GAAG,OAAO,CAAC,eAAe,CAAC,CAOjG;IAED,sCAAsC;IACtC,IAAW,OAAO,6BAEjB;IAED,uDAAuD;IACvD,IAAW,cAAc,4BAExB;IAED;;;;OAIG;IACI,IAAI,CAAC,EACV,aAAkB,EAClB,QAAa,EACd,EAAE;QACD,iDAAiD;QACjD,aAAa,CAAC,EAAE,WAAW,EAAE,CAAC;QAC9B,4CAA4C;QAC5C,QAAQ,CAAC,EAAE,OAAO,EAAE,CAAC;KACtB,GAAG,YAAY,CAWf;CACF"}
|
|
@@ -1,17 +1,27 @@
|
|
|
1
|
+
import { Fr } from '@aztec/foundation/fields';
|
|
1
2
|
import { getInitializer } from '@aztec/stdlib/abi';
|
|
2
3
|
import { AztecAddress } from '@aztec/stdlib/aztec-address';
|
|
3
|
-
import { computePartialAddress, getContractClassFromArtifact,
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
4
|
+
import { computePartialAddress, getContractClassFromArtifact, getContractInstanceFromInstantiationParams } from '@aztec/stdlib/contract';
|
|
5
|
+
import { collectOffchainEffects } from '@aztec/stdlib/tx';
|
|
6
|
+
import { mergeExecutionPayloads } from '@aztec/stdlib/tx';
|
|
7
|
+
import { publishContractClass } from '../deployment/publish_class.js';
|
|
8
|
+
import { publishInstance } from '../deployment/publish_instance.js';
|
|
6
9
|
import { BaseContractInteraction } from './base_contract_interaction.js';
|
|
7
10
|
import { ContractFunctionInteraction } from './contract_function_interaction.js';
|
|
8
|
-
import { DeployProvenTx } from './deploy_proven_tx.js';
|
|
9
11
|
import { DeploySentTx } from './deploy_sent_tx.js';
|
|
10
|
-
|
|
11
|
-
|
|
12
|
+
import { getGasLimits } from './get_gas_limits.js';
|
|
13
|
+
import { toProfileOptions, toSendOptions, toSimulateOptions } from './interaction_options.js';
|
|
12
14
|
/**
|
|
13
|
-
* Contract interaction for deployment.
|
|
14
|
-
* and initialization of the contract.
|
|
15
|
+
* Contract interaction for deployment.
|
|
16
|
+
* Handles class publication, instance publication, and initialization of the contract.
|
|
17
|
+
*
|
|
18
|
+
* Note that for some contracts, a tx is not required as part of its "creation":
|
|
19
|
+
* If there are no public functions, and if there are no initialization functions,
|
|
20
|
+
* then technically the contract has already been "created", and all of the contract's
|
|
21
|
+
* functions (private and utility) can be interacted-with immediately, without any
|
|
22
|
+
* "deployment tx".
|
|
23
|
+
*
|
|
24
|
+
* Extends the BaseContractInteraction class.
|
|
15
25
|
*/ export class DeployMethod extends BaseContractInteraction {
|
|
16
26
|
publicKeys;
|
|
17
27
|
artifact;
|
|
@@ -19,99 +29,57 @@ import { DeploySentTx } from './deploy_sent_tx.js';
|
|
|
19
29
|
args;
|
|
20
30
|
/** The contract instance to be deployed. */ instance;
|
|
21
31
|
/** Constructor function to call. */ constructorArtifact;
|
|
22
|
-
constructor(publicKeys, wallet, artifact, postDeployCtor, args = [], constructorNameOrArtifact){
|
|
23
|
-
super(wallet), this.publicKeys = publicKeys, this.artifact = artifact, this.postDeployCtor = postDeployCtor, this.args = args, this.instance = undefined;
|
|
32
|
+
constructor(publicKeys, wallet, artifact, postDeployCtor, args = [], constructorNameOrArtifact, authWitnesses = [], capsules = []){
|
|
33
|
+
super(wallet, authWitnesses, capsules), this.publicKeys = publicKeys, this.artifact = artifact, this.postDeployCtor = postDeployCtor, this.args = args, this.instance = undefined;
|
|
24
34
|
this.constructorArtifact = getInitializer(artifact, constructorNameOrArtifact);
|
|
25
35
|
}
|
|
26
36
|
/**
|
|
27
|
-
*
|
|
28
|
-
*
|
|
29
|
-
*
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
*/ async create(options = {}) {
|
|
35
|
-
return this.wallet.createTxExecutionRequest(await this.request(options));
|
|
36
|
-
}
|
|
37
|
-
// REFACTOR: Having a `request` method with different semantics than the ones in the other
|
|
38
|
-
// derived ContractInteractions is confusing. We should unify the flow of all ContractInteractions.
|
|
39
|
-
/**
|
|
40
|
-
* Returns an array of function calls that represent this operation. Useful as a building
|
|
41
|
-
* block for constructing batch requests.
|
|
42
|
-
* @param options - Deployment options.
|
|
43
|
-
* @returns An array of function calls.
|
|
44
|
-
* @remarks This method does not have the same return type as the `request` in the ContractInteraction object,
|
|
45
|
-
* it returns a promise for an array instead of a function call directly.
|
|
46
|
-
*/ async request(options = {}) {
|
|
47
|
-
const deployment = await this.getDeploymentFunctionCalls(options);
|
|
48
|
-
// NOTE: MEGA HACK. Remove with #10007
|
|
49
|
-
// register the contract after generating deployment function calls in order to publicly register the class and (optioanlly) emit its bytecode
|
|
50
|
-
//
|
|
51
|
-
// TODO: Should we add the contracts to the DB here, or once the tx has been sent or mined?
|
|
52
|
-
// Note that we need to run this registerContract here so it's available when computeFeeOptionsFromEstimatedGas
|
|
53
|
-
// runs, since it needs the contract to have been registered in order to estimate gas for its initialization,
|
|
54
|
-
// in case the initializer is public. This hints at the need of having "transient" contracts scoped to a
|
|
55
|
-
// simulation, so we can run the simulation with a set of contracts, but only "commit" them to the wallet
|
|
56
|
-
// once this tx has gone through.
|
|
57
|
-
await this.wallet.registerContract({
|
|
58
|
-
artifact: this.artifact,
|
|
59
|
-
instance: await this.getInstance(options)
|
|
60
|
-
});
|
|
61
|
-
const bootstrap = await this.getInitializeFunctionCalls(options);
|
|
62
|
-
if (deployment.calls.length + bootstrap.calls.length === 0) {
|
|
63
|
-
throw new Error(`No function calls needed to deploy contract ${this.artifact.name}`);
|
|
37
|
+
* Returns the execution payload that allows this operation to happen on chain.
|
|
38
|
+
* @param options - Configuration options.
|
|
39
|
+
* @returns The execution payload for this operation
|
|
40
|
+
*/ async request(options) {
|
|
41
|
+
const publication = await this.getPublicationExecutionPayload(options);
|
|
42
|
+
if (!options?.skipRegistration) {
|
|
43
|
+
await this.wallet.registerContract(await this.getInstance(options), this.artifact);
|
|
64
44
|
}
|
|
65
|
-
const
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
const { cancellable, nonce, fee: userFee } = options;
|
|
82
|
-
const request = {
|
|
83
|
-
calls,
|
|
84
|
-
authWitnesses,
|
|
85
|
-
hashedArguments,
|
|
86
|
-
capsules,
|
|
87
|
-
cancellable,
|
|
88
|
-
fee: userFee,
|
|
89
|
-
nonce
|
|
90
|
-
};
|
|
91
|
-
const fee = await this.getFeeOptions(request);
|
|
45
|
+
const initialization = await this.getInitializationExecutionPayload(options);
|
|
46
|
+
const feeExecutionPayload = options?.fee?.paymentMethod ? await options.fee.paymentMethod.getExecutionPayload() : undefined;
|
|
47
|
+
const finalExecutionPayload = feeExecutionPayload ? mergeExecutionPayloads([
|
|
48
|
+
feeExecutionPayload,
|
|
49
|
+
publication,
|
|
50
|
+
initialization
|
|
51
|
+
]) : mergeExecutionPayloads([
|
|
52
|
+
publication,
|
|
53
|
+
initialization
|
|
54
|
+
]);
|
|
55
|
+
if (!finalExecutionPayload.calls.length) {
|
|
56
|
+
throw new Error(`No transactions are needed to publish or initialize contract ${this.artifact.name}`);
|
|
57
|
+
}
|
|
58
|
+
return finalExecutionPayload;
|
|
59
|
+
}
|
|
60
|
+
convertDeployOptionsToRequestOptions(options) {
|
|
92
61
|
return {
|
|
93
|
-
...
|
|
94
|
-
|
|
62
|
+
...options,
|
|
63
|
+
deployer: !options?.universalDeploy ? options.from : undefined
|
|
95
64
|
};
|
|
96
65
|
}
|
|
97
66
|
/**
|
|
98
|
-
*
|
|
67
|
+
* Adds this contract to the wallet and returns the Contract object.
|
|
99
68
|
* @param options - Deployment options.
|
|
100
|
-
*/ async register(options
|
|
69
|
+
*/ async register(options) {
|
|
101
70
|
const instance = await this.getInstance(options);
|
|
102
|
-
await this.wallet.registerContract(
|
|
103
|
-
|
|
104
|
-
instance
|
|
105
|
-
});
|
|
106
|
-
return this.postDeployCtor(instance.address, this.wallet);
|
|
71
|
+
await this.wallet.registerContract(instance, this.artifact);
|
|
72
|
+
return this.postDeployCtor(instance, this.wallet);
|
|
107
73
|
}
|
|
108
74
|
/**
|
|
109
|
-
* Returns
|
|
110
|
-
*
|
|
111
|
-
*
|
|
112
|
-
|
|
75
|
+
* Returns an execution payload for:
|
|
76
|
+
* - publication of the contract class and
|
|
77
|
+
* - publication of the contract instance to enable public execution
|
|
78
|
+
* depending on the provided options.
|
|
79
|
+
* @param options - Contract creation options.
|
|
80
|
+
* @returns An execution payload with potentially calls (and bytecode capsule) to the class registry and instance registry.
|
|
81
|
+
*/ async getPublicationExecutionPayload(options) {
|
|
113
82
|
const calls = [];
|
|
114
|
-
const capsules = [];
|
|
115
83
|
// Set contract instance object so it's available for populating the DeploySendTx object
|
|
116
84
|
const instance = await this.getInstance(options);
|
|
117
85
|
// Obtain contract class from artifact and check it matches the reported one by the instance.
|
|
@@ -120,88 +88,105 @@ import { DeploySentTx } from './deploy_sent_tx.js';
|
|
|
120
88
|
if (!instance.currentContractClassId.equals(contractClass.id)) {
|
|
121
89
|
throw new Error(`Contract class mismatch when deploying contract: got ${instance.currentContractClassId.toString()} from instance and ${contractClass.id.toString()} from artifact`);
|
|
122
90
|
}
|
|
123
|
-
//
|
|
124
|
-
if (!options
|
|
91
|
+
// Publish the contract class if it hasn't been published already.
|
|
92
|
+
if (!options?.skipClassPublication) {
|
|
125
93
|
if ((await this.wallet.getContractClassMetadata(contractClass.id)).isContractClassPubliclyRegistered) {
|
|
126
|
-
this.log.debug(`Skipping
|
|
94
|
+
this.log.debug(`Skipping publication of already-registered contract class ${contractClass.id.toString()} for ${instance.address.toString()}`);
|
|
127
95
|
} else {
|
|
128
|
-
this.log.info(`Creating request for
|
|
129
|
-
const registerContractClassInteraction = await
|
|
96
|
+
this.log.info(`Creating request for publishing contract class ${contractClass.id.toString()} as part of deployment for ${instance.address.toString()}`);
|
|
97
|
+
const registerContractClassInteraction = await publishContractClass(this.wallet, this.artifact);
|
|
130
98
|
calls.push(await registerContractClassInteraction.request());
|
|
131
|
-
capsules.push(...registerContractClassInteraction.getCapsules());
|
|
132
99
|
}
|
|
133
100
|
}
|
|
134
|
-
//
|
|
135
|
-
if (!options
|
|
136
|
-
|
|
101
|
+
// Publish the contract instance:
|
|
102
|
+
if (!options?.skipInstancePublication) {
|
|
103
|
+
// TODO(https://github.com/AztecProtocol/aztec-packages/issues/15596):
|
|
104
|
+
// Read the artifact, and if there are no public functions, warn the caller that publication of the
|
|
105
|
+
// contract instance is not necessary (until such time as they wish to update the instance (i.e. change its class_id)).
|
|
106
|
+
const deploymentInteraction = await publishInstance(this.wallet, instance);
|
|
137
107
|
calls.push(await deploymentInteraction.request());
|
|
138
|
-
capsules.push(...deploymentInteraction.getCapsules());
|
|
139
108
|
}
|
|
140
|
-
return
|
|
141
|
-
calls,
|
|
142
|
-
capsules
|
|
143
|
-
};
|
|
109
|
+
return mergeExecutionPayloads(calls);
|
|
144
110
|
}
|
|
145
111
|
/**
|
|
146
112
|
* Returns the calls necessary to initialize the contract.
|
|
147
113
|
* @param options - Deployment options.
|
|
148
114
|
* @returns - An array of function calls.
|
|
149
|
-
*/ async
|
|
150
|
-
const
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
if (this.constructorArtifact && !options.skipInitialization) {
|
|
115
|
+
*/ async getInitializationExecutionPayload(options) {
|
|
116
|
+
const executionsPayloads = [];
|
|
117
|
+
if (this.constructorArtifact && !options?.skipInitialization) {
|
|
118
|
+
const { address } = await this.getInstance(options);
|
|
154
119
|
const constructorCall = new ContractFunctionInteraction(this.wallet, address, this.constructorArtifact, this.args);
|
|
155
|
-
|
|
156
|
-
capsules.push(...constructorCall.getCapsules());
|
|
120
|
+
executionsPayloads.push(await constructorCall.request());
|
|
157
121
|
}
|
|
158
|
-
return
|
|
159
|
-
calls,
|
|
160
|
-
capsules
|
|
161
|
-
};
|
|
122
|
+
return mergeExecutionPayloads(executionsPayloads);
|
|
162
123
|
}
|
|
163
124
|
/**
|
|
164
|
-
* Send
|
|
125
|
+
* Send a contract deployment transaction (initialize and/or publish) using the provided options.
|
|
165
126
|
* This function extends the 'send' method from the ContractFunctionInteraction class,
|
|
166
127
|
* allowing us to send a transaction specifically for contract deployment.
|
|
167
128
|
*
|
|
168
129
|
* @param options - An object containing various deployment options such as contractAddressSalt and from.
|
|
169
130
|
* @returns A SentTx object that returns the receipt and the deployed contract instance.
|
|
170
|
-
*/ send(options
|
|
171
|
-
const
|
|
131
|
+
*/ send(options) {
|
|
132
|
+
const sendTx = async ()=>{
|
|
133
|
+
const executionPayload = await this.request(this.convertDeployOptionsToRequestOptions(options));
|
|
134
|
+
const sendOptions = toSendOptions(options);
|
|
135
|
+
return this.wallet.sendTx(executionPayload, sendOptions);
|
|
136
|
+
};
|
|
172
137
|
this.log.debug(`Sent deployment tx of ${this.artifact.name} contract`);
|
|
173
|
-
return new DeploySentTx(this.wallet,
|
|
138
|
+
return new DeploySentTx(this.wallet, sendTx, this.postDeployCtor, ()=>this.getInstance(options));
|
|
174
139
|
}
|
|
175
140
|
/**
|
|
176
|
-
* Builds the contract instance
|
|
141
|
+
* Builds the contract instance and returns it.
|
|
177
142
|
*
|
|
178
|
-
* @param options - An object containing various
|
|
143
|
+
* @param options - An object containing various initialization and publication options.
|
|
179
144
|
* @returns An instance object.
|
|
180
|
-
*/ async getInstance(options
|
|
145
|
+
*/ async getInstance(options) {
|
|
181
146
|
if (!this.instance) {
|
|
182
|
-
this.instance = await
|
|
147
|
+
this.instance = await getContractInstanceFromInstantiationParams(this.artifact, {
|
|
183
148
|
constructorArgs: this.args,
|
|
184
|
-
salt: options.
|
|
149
|
+
salt: options?.contractAddressSalt ?? Fr.random(),
|
|
185
150
|
publicKeys: this.publicKeys,
|
|
186
151
|
constructorArtifact: this.constructorArtifact,
|
|
187
|
-
deployer: options
|
|
152
|
+
deployer: options?.deployer ? options.deployer : AztecAddress.ZERO
|
|
188
153
|
});
|
|
189
154
|
}
|
|
190
155
|
return this.instance;
|
|
191
156
|
}
|
|
192
157
|
/**
|
|
193
|
-
*
|
|
194
|
-
*
|
|
195
|
-
* @
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
158
|
+
* Simulate the deployment
|
|
159
|
+
*
|
|
160
|
+
* @param options - An optional object containing additional configuration for the simulation.
|
|
161
|
+
* @returns A simulation result object containing metadata of the execution, including gas
|
|
162
|
+
* estimations (if requested via options), execution statistics and emitted offchain effects
|
|
163
|
+
*/ async simulate(options) {
|
|
164
|
+
const executionPayload = await this.request(this.convertDeployOptionsToRequestOptions(options));
|
|
165
|
+
const simulatedTx = await this.wallet.simulateTx(executionPayload, toSimulateOptions(options));
|
|
166
|
+
const { gasLimits, teardownGasLimits } = getGasLimits(simulatedTx, options.fee?.estimatedGasPadding);
|
|
167
|
+
this.log.verbose(`Estimated gas limits for tx: DA=${gasLimits.daGas} L2=${gasLimits.l2Gas} teardownDA=${teardownGasLimits.daGas} teardownL2=${teardownGasLimits.l2Gas}`);
|
|
168
|
+
return {
|
|
169
|
+
stats: simulatedTx.stats,
|
|
170
|
+
offchainEffects: collectOffchainEffects(simulatedTx.privateExecutionResult),
|
|
171
|
+
result: undefined,
|
|
172
|
+
estimatedGas: {
|
|
173
|
+
gasLimits,
|
|
174
|
+
teardownGasLimits
|
|
175
|
+
}
|
|
176
|
+
};
|
|
199
177
|
}
|
|
200
178
|
/**
|
|
201
|
-
*
|
|
202
|
-
* @param options -
|
|
203
|
-
|
|
204
|
-
|
|
179
|
+
* Simulate a deployment and profile the gate count for each function in the transaction.
|
|
180
|
+
* @param options - Same options as `send`, plus extra profiling options.
|
|
181
|
+
*
|
|
182
|
+
* @returns An object containing the function return value and profile result.
|
|
183
|
+
*/ async profile(options) {
|
|
184
|
+
const executionPayload = await this.request(this.convertDeployOptionsToRequestOptions(options));
|
|
185
|
+
return await this.wallet.profileTx(executionPayload, {
|
|
186
|
+
...toProfileOptions(options),
|
|
187
|
+
profileMode: options.profileMode,
|
|
188
|
+
skipProofGeneration: options.skipProofGeneration
|
|
189
|
+
});
|
|
205
190
|
}
|
|
206
191
|
/** Return this deployment address. */ get address() {
|
|
207
192
|
return this.instance?.address;
|
|
@@ -209,4 +194,11 @@ import { DeploySentTx } from './deploy_sent_tx.js';
|
|
|
209
194
|
/** Returns the partial address for this deployment. */ get partialAddress() {
|
|
210
195
|
return this.instance && computePartialAddress(this.instance);
|
|
211
196
|
}
|
|
197
|
+
/**
|
|
198
|
+
* Augments this DeployMethod with additional metadata, such as authWitnesses and capsules.
|
|
199
|
+
* @param options - An object containing the metadata to add to the interaction
|
|
200
|
+
* @returns A new DeployMethod with the added metadata, but calling the same original function in the same manner
|
|
201
|
+
*/ with({ authWitnesses = [], capsules = [] }) {
|
|
202
|
+
return new DeployMethod(this.publicKeys, this.wallet, this.artifact, this.postDeployCtor, this.args, this.constructorArtifact?.name, this.authWitnesses.concat(authWitnesses), this.capsules.concat(capsules));
|
|
203
|
+
}
|
|
212
204
|
}
|