feat(common,core,python,tests): support creating Stellar contracts.
What changed, and why it matters
This commit adds support for a new Stellar blockchain feature: creating smart contracts (contract deployment) on Trezor hardware wallets. It extends the messages, layouts, serialization, and tests so users can review and sign Stellar 'create contract' transactions and related authorization entries. There is no indication of a security vulnerability in the change itself; it is a feature addition with explicit user confirmation steps and deliberate exclusions of unsupported variants.
No security action required. Treat as a normal feature review: verify test coverage, ensure translation strings are signed, and confirm the new confirmation flow matches product requirements.
Security signals we found
New transaction type support with on-device user confirmation
Explicit rejection of unsupported Stellar Asset Contract deployment and legacy CREATE_CONTRACT
Length validation on salt (32 bytes) and wasm_hash (32 bytes)
Root authorization entry matching compares serialized XDR of create-contract args
No vendor disclosure of security relevance, CVE, or researcher attribution in commit materials
Evidence from the diff
The patch implements CREATE_CONTRACT_V2 host function handling in Stellar InvokeHostFunctionOp and CREATE_CONTRACT_V2_HOST_FN in Soroban authorization entries. It introduces new protobuf messages (StellarContractIDPreimage, StellarContractExecutable, StellarCreateContractArgsV2), derives the deployed contract address for display, confirms the Wasm hash and constructor args on device, and rejects unsupported preimage/executable/host-function types. The implementation includes serialization, layout confirmation, root-auth-entry matching, translation strings, and test fixtures.
Changed components
common/protob/messages-stellar.protocore/src/apps/stellar/helpers.pycore/src/apps/stellar/layout.pycore/src/apps/stellar/operations/layout.pycore/src/apps/stellar/operations/serialize.pycore/src/apps/stellar/writers.pypython/src/trezorlib/stellar_sdk_helpers.pycore/src/trezor/messages.pypython/src/trezorlib/messages.pyrust/trezor-client/src/protos/generated/messages_stellar.rsInspect captured patch +2385 / −112
### common/protob/messages-stellar.proto
@@ -398,17 +398,74 @@ message StellarInvokeContractArgs {
}
/**
- * https://github.com/stellar/stellar-xdr/blob/v26.0/Stellar-transaction.x#L540
+ * https://github.com/stellar/stellar-xdr/blob/v28.0/Stellar-transaction.x#L489
+ * @embed
+ */
+message StellarContractIDPreimage {
+ required StellarContractIDPreimageType type = 1;
+ optional StellarContractIDPreimageFromAddress from_address = 2;
+
+ enum StellarContractIDPreimageType {
+ CONTRACT_ID_PREIMAGE_FROM_ADDRESS = 0;
+ // Deploying the Stellar Asset Contract of an asset is intentionally not
+ // supported. Its creation needs no authorization, and CAP-46-11 does
+ // not even allow it in authorization entries, so it can only be the
+ // host function of an operation, where anyone can invoke it and the
+ // deployer gains nothing: there is nothing security-relevant for the
+ // user to confirm on the device.
+ reserved 1; // CONTRACT_ID_PREIMAGE_FROM_ASSET
+ }
+
+ message StellarContractIDPreimageFromAddress {
+ required string address = 1; // the deployer address
+ required bytes salt = 2; // 32-byte salt
+ }
+}
+
+/**
+ * https://github.com/stellar/stellar-xdr/blob/v28.0/Stellar-contract.x#L229
+ * @embed
+ */
+message StellarContractExecutable {
+ required StellarContractExecutableType type = 1;
+ optional bytes wasm_hash = 2; // CONTRACT_EXECUTABLE_WASM: 32-byte hash of the uploaded Wasm code
+
+ enum StellarContractExecutableType {
+ CONTRACT_EXECUTABLE_WASM = 0;
+ // Only used by the Stellar Asset Contract, whose deployment is not
+ // supported (see StellarContractIDPreimageType).
+ reserved 1; // CONTRACT_EXECUTABLE_STELLAR_ASSET
+ reserved 2; // CONTRACT_EXECUTABLE_EXTERNAL_REF (Protocol 28), not supported yet
+ }
+}
+
+/**
+ * https://github.com/stellar/stellar-xdr/blob/v28.0/Stellar-transaction.x#L507
+ * @embed
+ */
+message StellarCreateContractArgsV2 {
+ required StellarContractIDPreimage contract_id_preimage = 1;
+ required StellarContractExecutable executable = 2;
+ repeated StellarSCVal constructor_args = 3; // arguments of the contract's constructor
+}
+
+/**
+ * https://github.com/stellar/stellar-xdr/blob/v28.0/Stellar-transaction.x#L540
* @embed
*/
message StellarSorobanAuthorizedFunction {
required StellarSorobanAuthorizedFunctionType type = 1;
optional StellarInvokeContractArgs contract_fn = 2;
+ optional StellarCreateContractArgsV2 create_contract_v2_host_fn = 3;
enum StellarSorobanAuthorizedFunctionType {
SOROBAN_AUTHORIZED_FUNCTION_TYPE_CONTRACT_FN = 0;
- reserved 1; // SOROBAN_AUTHORIZED_FUNCTION_TYPE_CREATE_CONTRACT_HOST_FN, not supported yet
- reserved 2; // SOROBAN_AUTHORIZED_FUNCTION_TYPE_CREATE_CONTRACT_V2_HOST_FN, not supported yet
+ // The legacy contract creation without constructor arguments is
+ // superseded by the V2 variant, which the host records in
+ // authorization entries since Protocol 22, and is intentionally not
+ // supported.
+ reserved 1; // SOROBAN_AUTHORIZED_FUNCTION_TYPE_CREATE_CONTRACT_HOST_FN
+ SOROBAN_AUTHORIZED_FUNCTION_TYPE_CREATE_CONTRACT_V2_HOST_FN = 2;
}
}
@@ -422,18 +479,24 @@ message StellarSorobanAuthorizedInvocation {
}
/**
- * https://github.com/stellar/stellar-xdr/blob/v26.0/Stellar-transaction.x#L521
+ * https://github.com/stellar/stellar-xdr/blob/v28.0/Stellar-transaction.x#L521
* @embed
*/
message StellarHostFunction {
required StellarHostFunctionType type = 1;
optional StellarInvokeContractArgs invoke_contract = 2;
+ optional StellarCreateContractArgsV2 create_contract_v2 = 3;
enum StellarHostFunctionType {
- HOST_FUNCTION_TYPE_INVOKE_CONTRACT = 0; // We only support this type of host function at this time.
- reserved 1; // HOST_FUNCTION_TYPE_CREATE_CONTRACT, not supported yet
- reserved 2; // HOST_FUNCTION_TYPE_UPLOAD_CONTRACT_WASM, not supported yet
- reserved 3; // HOST_FUNCTION_TYPE_CREATE_CONTRACT_V2, not supported yet
+ HOST_FUNCTION_TYPE_INVOKE_CONTRACT = 0;
+ // The legacy contract creation without constructor arguments is
+ // superseded by the V2 variant (Protocol 22) and is intentionally not
+ // supported.
+ reserved 1; // HOST_FUNCTION_TYPE_CREATE_CONTRACT
+ // Uploading Wasm is intentionally not supported: there is no meaningful
+ // way for the user to verify the Wasm blob on the device.
+ reserved 2; // HOST_FUNCTION_TYPE_UPLOAD_CONTRACT_WASM
+ HOST_FUNCTION_TYPE_CREATE_CONTRACT_V2 = 3;
}
}
### common/tests/fixtures/stellar/sign_soroban_authorization.json
@@ -473,6 +473,117 @@
"public_key": "2f22b9c62f08b774f3ebe6dd6e7db93c3ec2cbde0279561a3d9c5225b8c32292",
"signature": "1PEmWWVlw5F2e8DEFoj+ZxcTtFyi93coyaYhtfRg4uy5ZX/0bIUKF7bDMthCyD6NWSQ+uSbqStM/D4i++IglCA=="
}
+ },
+ {
+ "name": "StellarSorobanAuthorization-create-contract",
+ "parameters": {
+ "xdr": "AAAAAgAAAAAAAAAALyK5xi8It3Tz6+bdbn25PD7Cy94CeVYaPZxSJbjDIpIAAAAAAAvikwAMNQAAAAAQAAAAAQAAAAAAAAACAAAAAAAAAAAAAAAALyK5xi8It3Tz6+bdbn25PD7Cy94CeVYaPZxSJbjDIpIAAQIDBAUGBwgJCgsMDQ4PEBESExQVFhcYGRobHB0eHwAAAADkwV6j1aS2ore7CzSk48+PRdni8LGlxtfo+QobLD1OXwAAAAMAAAASAAAAAAAAAAAvIrnGLwi3dPPr5t1ufbk8PsLL3gJ5Vho9nFIluMMikgAAAAMAAAAHAAAADgAAAAVoZWxsbwAAAAAAAAA=",
+ "address_n": "m/44'/148'/0'",
+ "network_passphrase": "Test SDF Network ; September 2015",
+ "authorization": {
+ "nonce": 778899,
+ "signature_expiration_ledger": 800000,
+ "address": "GAXSFOOGF4ELO5HT5PTN23T5XE6D5QWL3YBHSVQ2HWOFEJNYYMRJENBV",
+ "invocation": {
+ "function": {
+ "type": "SOROBAN_AUTHORIZED_FUNCTION_TYPE_CREATE_CONTRACT_V2_HOST_FN",
+ "create_contract_v2_host_fn": {
+ "contract_id_preimage": {
+ "type": "CONTRACT_ID_PREIMAGE_FROM_ADDRESS",
+ "from_address": {
+ "address": "GAXSFOOGF4ELO5HT5PTN23T5XE6D5QWL3YBHSVQ2HWOFEJNYYMRJENBV",
+ "salt": "000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f"
+ }
+ },
+ "executable": {
+ "type": "CONTRACT_EXECUTABLE_WASM",
+ "wasm_hash": "e4c15ea3d5a4b6a2b7bb0b34a4e3cf8f45d9e2f0b1a5c6d7e8f90a1b2c3d4e5f"
+ },
+ "constructor_args": [
+ {
+ "type": "SCV_ADDRESS",
+ "address": "GAXSFOOGF4ELO5HT5PTN23T5XE6D5QWL3YBHSVQ2HWOFEJNYYMRJENBV"
+ },
+ {
+ "type": "SCV_U32",
+ "u32": 7
+ },
+ {
+ "type": "SCV_STRING",
+ "string": "68656c6c6f"
+ }
+ ]
+ }
+ }
+ }
+ }
+ },
+ "result": {
+ "public_key": "2f22b9c62f08b774f3ebe6dd6e7db93c3ec2cbde0279561a3d9c5225b8c32292",
+ "signature": "C7BPJyvu78NDDU4bxl4HD1nVNGfLzvZIdJ9DYuFh4roH8e01zsR5878++6iQvDepire0XGak8GjcQH6XWuAaCA=="
+ }
+ },
+ {
+ "name": "StellarSorobanAuthorization-factory-deploy",
+ "parameters": {
+ "xdr": "AAAAAgAAAAAAAAAALyK5xi8It3Tz6+bdbn25PD7Cy94CeVYaPZxSJbjDIpIAAAAAAA8bOwAMNQAAAAAQAAAAAQAAAAAAAAAAAAAAAQMKERgfJi00O0JJUFdeZWxzeoGIj5adpKuyucDHztXcAAAABmRlcGxveQAAAAAAAgAAABIAAAAAAAAAAC8iucYvCLd08+vm3W59uTw+wsveAnlWGj2cUiW4wyKSAAAADQAAACAAAQIDBAUGBwgJCgsMDQ4PEBESExQVFhcYGRobHB0eHwAAAAEAAAACAAAAAAAAAAAAAAAALyK5xi8It3Tz6+bdbn25PD7Cy94CeVYaPZxSJbjDIpIAAQIDBAUGBwgJCgsMDQ4PEBESExQVFhcYGRobHB0eHwAAAADkwV6j1aS2ore7CzSk48+PRdni8LGlxtfo+QobLD1OXwAAAAEAAAASAAAAAAAAAAAvIrnGLwi3dPPr5t1ufbk8PsLL3gJ5Vho9nFIluMMikgAAAAA=",
+ "address_n": "m/44'/148'/0'",
+ "network_passphrase": "Test SDF Network ; September 2015",
+ "authorization": {
+ "nonce": 990011,
+ "signature_expiration_ledger": 800000,
+ "address": "GAXSFOOGF4ELO5HT5PTN23T5XE6D5QWL3YBHSVQ2HWOFEJNYYMRJENBV",
+ "invocation": {
+ "function": {
+ "type": "SOROBAN_AUTHORIZED_FUNCTION_TYPE_CONTRACT_FN",
+ "contract_fn": {
+ "contract_address": "CABQUEIYD4TC2NB3IJEVAV26MVWHG6UBRCHZNHNEVOZLTQGHZ3K5ZIRI",
+ "function_name": "deploy",
+ "args": [
+ {
+ "type": "SCV_ADDRESS",
+ "address": "GAXSFOOGF4ELO5HT5PTN23T5XE6D5QWL3YBHSVQ2HWOFEJNYYMRJENBV"
+ },
+ {
+ "type": "SCV_BYTES",
+ "bytes": "000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f"
+ }
+ ]
+ }
+ },
+ "sub_invocations": [
+ {
+ "function": {
+ "type": "SOROBAN_AUTHORIZED_FUNCTION_TYPE_CREATE_CONTRACT_V2_HOST_FN",
+ "create_contract_v2_host_fn": {
+ "contract_id_preimage": {
+ "type": "CONTRACT_ID_PREIMAGE_FROM_ADDRESS",
+ "from_address": {
+ "address": "GAXSFOOGF4ELO5HT5PTN23T5XE6D5QWL3YBHSVQ2HWOFEJNYYMRJENBV",
+ "salt": "000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f"
+ }
+ },
+ "executable": {
+ "type": "CONTRACT_EXECUTABLE_WASM",
+ "wasm_hash": "e4c15ea3d5a4b6a2b7bb0b34a4e3cf8f45d9e2f0b1a5c6d7e8f90a1b2c3d4e5f"
+ },
+ "constructor_args": [
+ {
+ "type": "SCV_ADDRESS",
+ "address": "GAXSFOOGF4ELO5HT5PTN23T5XE6D5QWL3YBHSVQ2HWOFEJNYYMRJENBV"
+ }
+ ]
+ }
+ }
+ }
+ ]
+ }
+ }
+ },
+ "result": {
+ "public_key": "2f22b9c62f08b774f3ebe6dd6e7db93c3ec2cbde0279561a3d9c5225b8c32292",
+ "signature": "HWUiAAs7499Zakxm/8MEe6erzgN9zFZrjKsiuuFTF4oHGDH2Z7CdAMraecEj0O8tzNKqjv+TdrEWPluceXW7Cg=="
+ }
}
]
}
### common/tests/fixtures/stellar/sign_tx.json
@@ -2871,6 +2871,354 @@
"signature": "NwACNJ1pg0BEV6LxOq1IgpN0r1Z05pYwlogNFXIclwWt3wF1ekt7UhXdFVBphNTZU2ZzTystrGQZ+xChuMzmBw=="
},
"skip_models": ["t1b1"]
+ },
+ {
+ "name": "StellarInvokeHostFunction-create-contract",
+ "parameters": {
+ "xdr": "AAAAAgAAAAAvIrnGLwi3dPPr5t1ufbk8PsLL3gJ5Vho9nFIluMMikgAAw7QAAAAAAAAbWQAAAAEAAAAAAAAAAAAAAABw29iAAAAAAAAAAAEAAAAAAAAAGAAAAAMAAAAAAAAAAAAAAAAvIrnGLwi3dPPr5t1ufbk8PsLL3gJ5Vho9nFIluMMikgABAgMEBQYHCAkKCwwNDg8QERITFBUWFxgZGhscHR4fAAAAAOTBXqPVpLait7sLNKTjz49F2eLwsaXG1+j5ChssPU5fAAAAAAAAAAEAAAAAAAAAAgAAAAAAAAAAAAAAAC8iucYvCLd08+vm3W59uTw+wsveAnlWGj2cUiW4wyKSAAECAwQFBgcICQoLDA0ODxAREhMUFRYXGBkaGxwdHh8AAAAA5MFeo9WktqK3uws0pOPPj0XZ4vCxpcbX6PkKGyw9Tl8AAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADDUAAAAAA=",
+ "address_n": "m/44'/148'/0'",
+ "network_passphrase": "Test SDF Network ; September 2015",
+ "tx": {
+ "source_account": "GAXSFOOGF4ELO5HT5PTN23T5XE6D5QWL3YBHSVQ2HWOFEJNYYMRJENBV",
+ "fee": 50100,
+ "sequence_number": 7001,
+ "timebounds_start": 0,
+ "timebounds_end": 1893456000,
+ "memo_type": "NONE"
+ },
+ "operations": [
+ {
+ "_message_type": "StellarInvokeHostFunctionOp",
+ "function": {
+ "type": "HOST_FUNCTION_TYPE_CREATE_CONTRACT_V2",
+ "create_contract_v2": {
+ "contract_id_preimage": {
+ "type": "CONTRACT_ID_PREIMAGE_FROM_ADDRESS",
+ "from_address": {
+ "address": "GAXSFOOGF4ELO5HT5PTN23T5XE6D5QWL3YBHSVQ2HWOFEJNYYMRJENBV",
+ "salt": "000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f"
+ }
+ },
+ "executable": {
+ "type": "CONTRACT_EXECUTABLE_WASM",
+ "wasm_hash": "e4c15ea3d5a4b6a2b7bb0b34a4e3cf8f45d9e2f0b1a5c6d7e8f90a1b2c3d4e5f"
+ }
+ }
+ },
+ "auth": [
+ {
+ "credentials": {
+ "type": "SOROBAN_CREDENTIALS_SOURCE_ACCOUNT"
+ },
+ "root_invocation": {
+ "function": {
+ "type": "SOROBAN_AUTHORIZED_FUNCTION_TYPE_CREATE_CONTRACT_V2_HOST_FN",
+ "create_contract_v2_host_fn": {
+ "contract_id_preimage": {
+ "type": "CONTRACT_ID_PREIMAGE_FROM_ADDRESS",
+ "from_address": {
+ "address": "GAXSFOOGF4ELO5HT5PTN23T5XE6D5QWL3YBHSVQ2HWOFEJNYYMRJENBV",
+ "salt": "000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f"
+ }
+ },
+ "executable": {
+ "type": "CONTRACT_EXECUTABLE_WASM",
+ "wasm_hash": "e4c15ea3d5a4b6a2b7bb0b34a4e3cf8f45d9e2f0b1a5c6d7e8f90a1b2c3d4e5f"
+ }
+ }
+ }
+ }
+ }
+ ]
+ }
+ ],
+ "ext": {
+ "v": 1,
+ "soroban_data": "000000000000000000000000000000000000000000000000000000000000c350"
+ }
+ },
+ "result": {
+ "public_key": "2f22b9c62f08b774f3ebe6dd6e7db93c3ec2cbde0279561a3d9c5225b8c32292",
+ "signature": "ig75gd4mFGVuIyoYc7xBmXLvhHwjE/tlcWL6DcsrH3Z1myyMJ1wQ2uDw20BvpWYgF8WOd8N12+oL5eC8WEdYCQ=="
+ },
+ "skip_models": ["t1b1"]
+ },
+ {
+ "name": "StellarInvokeHostFunction-create-contract-constructor-args",
+ "parameters": {
+ "xdr": "AAAAAgAAAAAvIrnGLwi3dPPr5t1ufbk8PsLL3gJ5Vho9nFIluMMikgAAw7QAAAAAAAAbWgAAAAEAAAAAAAAAAAAAAABw29iAAAAAAAAAAAEAAAAAAAAAGAAAAAMAAAAAAAAAAAAAAAAvIrnGLwi3dPPr5t1ufbk8PsLL3gJ5Vho9nFIluMMikgABAgMEBQYHCAkKCwwNDg8QERITFBUWFxgZGhscHR4fAAAAAOTBXqPVpLait7sLNKTjz49F2eLwsaXG1+j5ChssPU5fAAAAAwAAABIAAAAAAAAAAC8iucYvCLd08+vm3W59uTw+wsveAnlWGj2cUiW4wyKSAAAAAwAAAAcAAAAOAAAABWhlbGxvAAAAAAAAAQAAAAAAAAACAAAAAAAAAAAAAAAALyK5xi8It3Tz6+bdbn25PD7Cy94CeVYaPZxSJbjDIpIAAQIDBAUGBwgJCgsMDQ4PEBESExQVFhcYGRobHB0eHwAAAADkwV6j1aS2ore7CzSk48+PRdni8LGlxtfo+QobLD1OXwAAAAMAAAASAAAAAAAAAAAvIrnGLwi3dPPr5t1ufbk8PsLL3gJ5Vho9nFIluMMikgAAAAMAAAAHAAAADgAAAAVoZWxsbwAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAw1AAAAAA",
+ "address_n": "m/44'/148'/0'",
+ "network_passphrase": "Test SDF Network ; September 2015",
+ "tx": {
+ "source_account": "GAXSFOOGF4ELO5HT5PTN23T5XE6D5QWL3YBHSVQ2HWOFEJNYYMRJENBV",
+ "fee": 50100,
+ "sequence_number": 7002,
+ "timebounds_start": 0,
+ "timebounds_end": 1893456000,
+ "memo_type": "NONE"
+ },
+ "operations": [
+ {
+ "_message_type": "StellarInvokeHostFunctionOp",
+ "function": {
+ "type": "HOST_FUNCTION_TYPE_CREATE_CONTRACT_V2",
+ "create_contract_v2": {
+ "contract_id_preimage": {
+ "type": "CONTRACT_ID_PREIMAGE_FROM_ADDRESS",
+ "from_address": {
+ "address": "GAXSFOOGF4ELO5HT5PTN23T5XE6D5QWL3YBHSVQ2HWOFEJNYYMRJENBV",
+ "salt": "000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f"
+ }
+ },
+ "executable": {
+ "type": "CONTRACT_EXECUTABLE_WASM",
+ "wasm_hash": "e4c15ea3d5a4b6a2b7bb0b34a4e3cf8f45d9e2f0b1a5c6d7e8f90a1b2c3d4e5f"
+ },
+ "constructor_args": [
+ {
+ "type": "SCV_ADDRESS",
+ "address": "GAXSFOOGF4ELO5HT5PTN23T5XE6D5QWL3YBHSVQ2HWOFEJNYYMRJENBV"
+ },
+ {
+ "type": "SCV_U32",
+ "u32": 7
+ },
+ {
+ "type": "SCV_STRING",
+ "string": "68656c6c6f"
+ }
+ ]
+ }
+ },
+ "auth": [
+ {
+ "credentials": {
+ "type": "SOROBAN_CREDENTIALS_SOURCE_ACCOUNT"
+ },
+ "root_invocation": {
+ "function": {
+ "type": "SOROBAN_AUTHORIZED_FUNCTION_TYPE_CREATE_CONTRACT_V2_HOST_FN",
+ "create_contract_v2_host_fn": {
+ "contract_id_preimage": {
+ "type": "CONTRACT_ID_PREIMAGE_FROM_ADDRESS",
+ "from_address": {
+ "address": "GAXSFOOGF4ELO5HT5PTN23T5XE6D5QWL3YBHSVQ2HWOFEJNYYMRJENBV",
+ "salt": "000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f"
+ }
+ },
+ "executable": {
+ "type": "CONTRACT_EXECUTABLE_WASM",
+ "wasm_hash": "e4c15ea3d5a4b6a2b7bb0b34a4e3cf8f45d9e2f0b1a5c6d7e8f90a1b2c3d4e5f"
+ },
+ "constructor_args": [
+ {
+ "type": "SCV_ADDRESS",
+ "address": "GAXSFOOGF4ELO5HT5PTN23T5XE6D5QWL3YBHSVQ2HWOFEJNYYMRJENBV"
+ },
+ {
+ "type": "SCV_U32",
+ "u32": 7
+ },
+ {
+ "type": "SCV_STRING",
+ "string": "68656c6c6f"
+ }
+ ]
+ }
+ }
+ }
+ }
+ ]
+ }
+ ],
+ "ext": {
+ "v": 1,
+ "soroban_data": "000000000000000000000000000000000000000000000000000000000000c350"
+ }
+ },
+ "result": {
+ "public_key": "2f22b9c62f08b774f3ebe6dd6e7db93c3ec2cbde0279561a3d9c5225b8c32292",
+ "signature": "B40RIDaiESR2lviGfU1+DhSg0QbogVAdB3flkAgTnXLYbuKn/qTDE6YabcIldioGHhD+Hf07y24dPy0wz+W+DQ=="
+ },
+ "skip_models": ["t1b1"]
+ },
+ {
+ "name": "StellarInvokeHostFunction-create-contract-other-deployer",
+ "parameters": {
+ "xdr": "AAAAAgAAAAAvIrnGLwi3dPPr5t1ufbk8PsLL3gJ5Vho9nFIluMMikgAAw7QAAAAAAAAbWwAAAAEAAAAAAAAAAAAAAABw29iAAAAAAAAAAAEAAAAAAAAAGAAAAAMAAAAAAAAAAAAAAABdVWQkZrGFuEMVLp4hkVHbxYkgJ+xAEBpRe+1coDDC4P/+/fz7+vn49/b19PPy8fDv7u3s6+rp6Ofm5eTj4uHgAAAAAOTBXqPVpLait7sLNKTjz49F2eLwsaXG1+j5ChssPU5fAAAAAAAAAAEAAAACAAAAAAAAAABdVWQkZrGFuEMVLp4hkVHbxYkgJ+xAEBpRe+1coDDC4AAAAAAACH6FAAquYAAAABAAAAABAAAAAAAAAAIAAAAAAAAAAAAAAABdVWQkZrGFuEMVLp4hkVHbxYkgJ+xAEBpRe+1coDDC4P/+/fz7+vn49/b19PPy8fDv7u3s6+rp6Ofm5eTj4uHgAAAAAOTBXqPVpLait7sLNKTjz49F2eLwsaXG1+j5ChssPU5fAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAw1AAAAAA",
+ "address_n": "m/44'/148'/0'",
+ "network_passphrase": "Test SDF Network ; September 2015",
+ "tx": {
+ "source_account": "GAXSFOOGF4ELO5HT5PTN23T5XE6D5QWL3YBHSVQ2HWOFEJNYYMRJENBV",
+ "fee": 50100,
+ "sequence_number": 7003,
+ "timebounds_start": 0,
+ "timebounds_end": 1893456000,
+ "memo_type": "NONE"
+ },
+ "operations": [
+ {
+ "_message_type": "StellarInvokeHostFunctionOp",
+ "function": {
+ "type": "HOST_FUNCTION_TYPE_CREATE_CONTRACT_V2",
+ "create_contract_v2": {
+ "contract_id_preimage": {
+ "type": "CONTRACT_ID_PREIMAGE_FROM_ADDRESS",
+ "from_address": {
+ "address": "GBOVKZBEM2YYLOCDCUXJ4IMRKHN4LCJAE7WEAEA2KF562XFAGDBOB64V",
+ "salt": "fffefdfcfbfaf9f8f7f6f5f4f3f2f1f0efeeedecebeae9e8e7e6e5e4e3e2e1e0"
+ }
+ },
+ "executable": {
+ "type": "CONTRACT_EXECUTABLE_WASM",
+ "wasm_hash": "e4c15ea3d5a4b6a2b7bb0b34a4e3cf8f45d9e2f0b1a5c6d7e8f90a1b2c3d4e5f"
+ }
+ }
+ },
+ "auth": [
+ {
+ "credentials": {
+ "type": "SOROBAN_CREDENTIALS_ADDRESS_V2",
+ "address_v2": {
+ "address": "GBOVKZBEM2YYLOCDCUXJ4IMRKHN4LCJAE7WEAEA2KF562XFAGDBOB64V",
+ "nonce": 556677,
+ "signature_expiration_ledger": 700000,
+ "signature": {
+ "type": "SCV_VEC"
+ }
+ }
+ },
+ "root_invocation": {
+ "function": {
+ "type": "SOROBAN_AUTHORIZED_FUNCTION_TYPE_CREATE_CONTRACT_V2_HOST_FN",
+ "create_contract_v2_host_fn": {
+ "contract_id_preimage": {
+ "type": "CONTRACT_ID_PREIMAGE_FROM_ADDRESS",
+ "from_address": {
+ "address": "GBOVKZBEM2YYLOCDCUXJ4IMRKHN4LCJAE7WEAEA2KF562XFAGDBOB64V",
+ "salt": "fffefdfcfbfaf9f8f7f6f5f4f3f2f1f0efeeedecebeae9e8e7e6e5e4e3e2e1e0"
+ }
+ },
+ "executable": {
+ "type": "CONTRACT_EXECUTABLE_WASM",
+ "wasm_hash": "e4c15ea3d5a4b6a2b7bb0b34a4e3cf8f45d9e2f0b1a5c6d7e8f90a1b2c3d4e5f"
+ }
+ }
+ }
+ }
+ }
+ ]
+ }
+ ],
+ "ext": {
+ "v": 1,
+ "soroban_data": "000000000000000000000000000000000000000000000000000000000000c350"
+ }
+ },
+ "result": {
+ "public_key": "2f22b9c62f08b774f3ebe6dd6e7db93c3ec2cbde0279561a3d9c5225b8c32292",
+ "signature": "uzW3rnwF6zKnbRfguwbi43VNT9sfH2a6xaf0axUYleWd+iwBXkS/uwzE0bNggWsr+OknPsPiy2kq4aa/+tJoBQ=="
+ },
+ "skip_models": ["t1b1"]
+ },
+ {
+ "name": "StellarInvokeHostFunction-factory-deploy",
+ "parameters": {
+ "xdr": "AAAAAgAAAAAvIrnGLwi3dPPr5t1ufbk8PsLL3gJ5Vho9nFIluMMikgAAw7QAAAAAAAAbXgAAAAEAAAAAAAAAAAAAAABw29iAAAAAAAAAAAEAAAAAAAAAGAAAAAAAAAABAwoRGB8mLTQ7QklQV15lbHN6gYiPlp2kq7K5wMfO1dwAAAAGZGVwbG95AAAAAAACAAAAEgAAAAAAAAAALyK5xi8It3Tz6+bdbn25PD7Cy94CeVYaPZxSJbjDIpIAAAANAAAAIAABAgMEBQYHCAkKCwwNDg8QERITFBUWFxgZGhscHR4fAAAAAQAAAAAAAAAAAAAAAQMKERgfJi00O0JJUFdeZWxzeoGIj5adpKuyucDHztXcAAAABmRlcGxveQAAAAAAAgAAABIAAAAAAAAAAC8iucYvCLd08+vm3W59uTw+wsveAnlWGj2cUiW4wyKSAAAADQAAACAAAQIDBAUGBwgJCgsMDQ4PEBESExQVFhcYGRobHB0eHwAAAAEAAAACAAAAAAAAAAAAAAAALyK5xi8It3Tz6+bdbn25PD7Cy94CeVYaPZxSJbjDIpIAAQIDBAUGBwgJCgsMDQ4PEBESExQVFhcYGRobHB0eHwAAAADkwV6j1aS2ore7CzSk48+PRdni8LGlxtfo+QobLD1OXwAAAAEAAAASAAAAAAAAAAAvIrnGLwi3dPPr5t1ufbk8PsLL3gJ5Vho9nFIluMMikgAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAw1AAAAAA",
+ "address_n": "m/44'/148'/0'",
+ "network_passphrase": "Test SDF Network ; September 2015",
+ "tx": {
+ "source_account": "GAXSFOOGF4ELO5HT5PTN23T5XE6D5QWL3YBHSVQ2HWOFEJNYYMRJENBV",
+ "fee": 50100,
+ "sequence_number": 7006,
+ "timebounds_start": 0,
+ "timebounds_end": 1893456000,
+ "memo_type": "NONE"
+ },
+ "operations": [
+ {
+ "_message_type": "StellarInvokeHostFunctionOp",
+ "function": {
+ "type": "HOST_FUNCTION_TYPE_INVOKE_CONTRACT",
+ "invoke_contract": {
+ "contract_address": "CABQUEIYD4TC2NB3IJEVAV26MVWHG6UBRCHZNHNEVOZLTQGHZ3K5ZIRI",
+ "function_name": "deploy",
+ "args": [
+ {
+ "type": "SCV_ADDRESS",
+ "address": "GAXSFOOGF4ELO5HT5PTN23T5XE6D5QWL3YBHSVQ2HWOFEJNYYMRJENBV"
+ },
+ {
+ "type": "SCV_BYTES",
+ "bytes": "000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f"
+ }
+ ]
+ }
+ },
+ "auth": [
+ {
+ "credentials": {
+ "type": "SOROBAN_CREDENTIALS_SOURCE_ACCOUNT"
+ },
+ "root_invocation": {
+ "function": {
+ "type": "SOROBAN_AUTHORIZED_FUNCTION_TYPE_CONTRACT_FN",
+ "contract_fn": {
+ "contract_address": "CABQUEIYD4TC2NB3IJEVAV26MVWHG6UBRCHZNHNEVOZLTQGHZ3K5ZIRI",
+ "function_name": "deploy",
+ "args": [
+ {
+ "type": "SCV_ADDRESS",
+ "address": "GAXSFOOGF4ELO5HT5PTN23T5XE6D5QWL3YBHSVQ2HWOFEJNYYMRJENBV"
+ },
+ {
+ "type": "SCV_BYTES",
+ "bytes": "000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f"
+ }
+ ]
+ }
+ },
+ "sub_invocations": [
+ {
+ "function": {
+ "type": "SOROBAN_AUTHORIZED_FUNCTION_TYPE_CREATE_CONTRACT_V2_HOST_FN",
+ "create_contract_v2_host_fn": {
+ "contract_id_preimage": {
+ "type": "CONTRACT_ID_PREIMAGE_FROM_ADDRESS",
+ "from_address": {
+ "address": "GAXSFOOGF4ELO5HT5PTN23T5XE6D5QWL3YBHSVQ2HWOFEJNYYMRJENBV",
+ "salt": "000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f"
+ }
+ },
+ "executable": {
+ "type": "CONTRACT_EXECUTABLE_WASM",
+ "wasm_hash": "e4c15ea3d5a4b6a2b7bb0b34a4e3cf8f45d9e2f0b1a5c6d7e8f90a1b2c3d4e5f"
+ },
+ "constructor_args": [
+ {
+ "type": "SCV_ADDRESS",
+ "address": "GAXSFOOGF4ELO5HT5PTN23T5XE6D5QWL3YBHSVQ2HWOFEJNYYMRJENBV"
+ }
+ ]
+ }
+ }
+ }
+ ]
+ }
+ }
+ ]
+ }
+ ],
+ "ext": {
+ "v": 1,
+ "soroban_data": "000000000000000000000000000000000000000000000000000000000000c350"
+ }
+ },
+ "result": {
+ "public_key": "2f22b9c62f08b774f3ebe6dd6e7db93c3ec2cbde0279561a3d9c5225b8c32292",
+ "signature": "OtGMqKfrGXojXiuxcI7op9ibfOBMKUH+S7OpQzgzOmI3NXvQMyGYgo+bgSGKvRlkaob3f15pbSdcIEyurL41Bw=="
+ },
+ "skip_models": ["t1b1"]
}
]
}
### core/.changelog.d/7313.added
@@ -0,0 +1 @@
+Stellar: Support creating contracts.
### core/embed/rust/librust_qstr.h
@@ -1510,6 +1510,7 @@ static void _librust_qstrs(void) {
MP_QSTR_stellar__delete;
MP_QSTR_stellar__delete_passive_offer;
MP_QSTR_stellar__delete_trust;
+ MP_QSTR_stellar__deploy_contract;
MP_QSTR_stellar__destination;
MP_QSTR_stellar__exchanges_require_memo;
MP_QSTR_stellar__ext_auth;
@@ -1562,6 +1563,7 @@ static void _librust_qstrs(void) {
MP_QSTR_stellar__valid_until_ledger;
MP_QSTR_stellar__value_sha256;
MP_QSTR_stellar__wanna_clean_value_key_template;
+ MP_QSTR_stellar__wasm_hash;
MP_QSTR_tezos__baker_address;
MP_QSTR_tezos__balance;
MP_QSTR_tezos__ballot;
### core/embed/rust/src/translations/generated/translated_string.rs
@@ -1679,6 +1679,10 @@ pub enum TranslatedString {
buttons__review = 1294, // {"Bolt": "", "Caesar": "", "Delizia": "", "Eckhart": "Review"}
buttons__cancel_sign = 1295, // "Cancel sign"
address__title_multisig_xpub_template = 1296, // "Multisig XPUB #{0} "
+ #[cfg(feature = "universal_fw")]
+ stellar__deploy_contract = 1297, // "Deploy contract"
+ #[cfg(feature = "universal_fw")]
+ stellar__wasm_hash = 1298, // "Wasm hash"
}
impl TranslatedString {
@@ -2983,6 +2987,8 @@ impl TranslatedString {
"",
"Cancel sign",
"Multisig XPUB #{0} ",
+ "Deploy contract",
+ "Wasm hash",
);
#[cfg(all(feature = "debug", feature = "universal_fw"))]
@@ -4285,6 +4291,8 @@ impl TranslatedString {
19080,
19091,
19110,
+ 19125,
+ 19134,
];
#[cfg(all(feature = "debug", not(feature = "universal_fw")))]
@@ -5586,6 +5594,8 @@ impl TranslatedString {
"",
"Cancel sign",
"Multisig XPUB #{0} ",
+ "Deploy contract",
+ "Wasm hash",
);
#[cfg(all(feature = "debug", not(feature = "universal_fw")))]
@@ -6888,6 +6898,8 @@ impl TranslatedString {
19080,
19091,
19110,
+ 19125,
+ 19134,
];
#[cfg(all(not(feature = "debug"), feature = "universal_fw"))]
@@ -8189,6 +8201,8 @@ impl TranslatedString {
"",
"Cancel sign",
"Multisig XPUB #{0} ",
+ "Deploy contract",
+ "Wasm hash",
);
#[cfg(all(not(feature = "debug"), feature = "universal_fw"))]
@@ -9491,6 +9505,8 @@ impl TranslatedString {
19080,
19091,
19110,
+ 19125,
+ 19134,
];
#[cfg(all(not(feature = "debug"), not(feature = "universal_fw")))]
@@ -10792,6 +10808,8 @@ impl TranslatedString {
"",
"Cancel sign",
"Multisig XPUB #{0} ",
+ "Deploy contract",
+ "Wasm hash",
);
#[cfg(all(not(feature = "debug"), not(feature = "universal_fw")))]
@@ -12094,6 +12112,8 @@ impl TranslatedString {
19080,
19091,
19110,
+ 19125,
+ 19134,
];
} else if #[cfg(feature = "layout_caesar")] {
@@ -13396,6 +13416,8 @@ impl TranslatedString {
"",
"Cancel sign",
"Multisig XPUB #{0} ",
+ "Deploy contract",
+ "Wasm hash",
);
#[cfg(all(feature = "debug", feature = "universal_fw"))]
@@ -14698,6 +14720,8 @@ impl TranslatedString {
16941,
16952,
16971,
+ 16986,
+ 16995,
];
#[cfg(all(feature = "debug", not(feature = "universal_fw")))]
@@ -15999,6 +16023,8 @@ impl TranslatedString {
"",
"Cancel sign",
"Multisig XPUB #{0} ",
+ "Deploy contract",
+ "Wasm hash",
);
#[cfg(all(feature = "debug", not(feature = "universal_fw")))]
@@ -17301,6 +17327,8 @@ impl TranslatedString {
16941,
16952,
16971,
+ 16986,
+ 16995,
];
#[cfg(all(not(feature = "debug"), feature = "universal_fw"))]
@@ -18602,6 +18630,8 @@ impl TranslatedString {
"",
"Cancel sign",
"Multisig XPUB #{0} ",
+ "Deploy contract",
+ "Wasm hash",
);
#[cfg(all(not(feature = "debug"), feature = "universal_fw"))]
@@ -19904,6 +19934,8 @@ impl TranslatedString {
16941,
16952,
16971,
+ 16986,
+ 16995,
];
#[cfg(all(not(feature = "debug"), not(feature = "universal_fw")))]
@@ -21205,6 +21237,8 @@ impl TranslatedString {
"",
"Cancel sign",
"Multisig XPUB #{0} ",
+ "Deploy contract",
+ "Wasm hash",
);
#[cfg(all(not(feature = "debug"), not(feature = "universal_fw")))]
@@ -22507,6 +22541,8 @@ impl TranslatedString {
16941,
16952,
16971,
+ 16986,
+ 16995,
];
} else if #[cfg(feature = "layout_delizia")] {
@@ -23809,6 +23845,8 @@ impl TranslatedString {
"",
"Cancel sign",
"Multisig XPUB #{0} ",
+ "Deploy contract",
+ "Wasm hash",
);
#[cfg(all(feature = "debug", feature = "universal_fw"))]
@@ -25111,6 +25149,8 @@ impl TranslatedString {
19023,
19034,
19053,
+ 19068,
+ 19077,
];
#[cfg(all(feature = "debug", not(feature = "universal_fw")))]
@@ -26412,6 +26452,8 @@ impl TranslatedString {
"",
"Cancel sign",
"Multisig XPUB #{0} ",
+ "Deploy contract",
+ "Wasm hash",
);
#[cfg(all(feature = "debug", not(feature = "universal_fw")))]
@@ -27714,6 +27756,8 @@ impl TranslatedString {
19023,
19034,
19053,
+ 19068,
+ 19077,
];
#[cfg(all(not(feature = "debug"), feature = "universal_fw"))]
@@ -29015,6 +29059,8 @@ impl TranslatedString {
"",
"Cancel sign",
"Multisig XPUB #{0} ",
+ "Deploy contract",
+ "Wasm hash",
);
#[cfg(all(not(feature = "debug"), feature = "universal_fw"))]
@@ -30317,6 +30363,8 @@ impl TranslatedString {
19023,
19034,
19053,
+ 19068,
+ 19077,
];
#[cfg(all(not(feature = "debug"), not(feature = "universal_fw")))]
@@ -31618,6 +31666,8 @@ impl TranslatedString {
"",
"Cancel sign",
"Multisig XPUB #{0} ",
+ "Deploy contract",
+ "Wasm hash",
);
#[cfg(all(not(feature = "debug"), not(feature = "universal_fw")))]
@@ -32920,6 +32970,8 @@ impl TranslatedString {
19023,
19034,
19053,
+ 19068,
+ 19077,
];
} else if #[cfg(feature = "layout_eckhart")] {
@@ -34222,6 +34274,8 @@ impl TranslatedString {
"Review",
"Cancel sign",
"Multisig XPUB #{0} ",
+ "Deploy contract",
+ "Wasm hash",
);
#[cfg(all(feature = "debug", feature = "universal_fw"))]
@@ -35524,6 +35578,8 @@ impl TranslatedString {
20476,
20487,
20506,
+ 20521,
+ 20530,
];
#[cfg(all(feature = "debug", not(feature = "universal_fw")))]
@@ -36825,6 +36881,8 @@ impl TranslatedString {
"Review",
"Cancel sign",
"Multisig XPUB #{0} ",
+ "Deploy contract",
+ "Wasm hash",
);
#[cfg(all(feature = "debug", not(feature = "universal_fw")))]
@@ -38127,6 +38185,8 @@ impl TranslatedString {
20476,
20487,
20506,
+ 20521,
+ 20530,
];
#[cfg(all(not(feature = "debug"), feature = "universal_fw"))]
@@ -39428,6 +39488,8 @@ impl TranslatedString {
"Review",
"Cancel sign",
"Multisig XPUB #{0} ",
+ "Deploy contract",
+ "Wasm hash",
);
#[cfg(all(not(feature = "debug"), feature = "universal_fw"))]
@@ -40730,6 +40792,8 @@ impl TranslatedString {
20476,
20487,
20506,
+ 20521,
+ 20530,
];
#[cfg(all(not(feature = "debug"), not(feature = "universal_fw")))]
@@ -42031,6 +42095,8 @@ impl TranslatedString {
"Review",
"Cancel sign",
"Multisig XPUB #{0} ",
+ "Deploy contract",
+ "Wasm hash",
);
#[cfg(all(not(feature = "debug"), not(feature = "universal_fw")))]
@@ -43333,6 +43399,8 @@ impl TranslatedString {
20476,
20487,
20506,
+ 20521,
+ 20530,
];
}
@@ -44678,6 +44746,8 @@ impl TranslatedString {
#[cfg(feature = "universal_fw")]
(Qstr::MP_QSTR_stellar__delete_trust, Self::stellar__delete_trust),
#[cfg(feature = "universal_fw")]
+ (Qstr::MP_QSTR_stellar__deploy_contract, Self::stellar__deploy_contract),
+ #[cfg(feature = "universal_fw")]
(Qstr::MP_QSTR_stellar__destination, Self::stellar__destination),
#[cfg(feature = "universal_fw")]
(Qstr::MP_QSTR_stellar__exchanges_require_memo, Self::stellar__exchanges_require_memo),
@@ -44781,6 +44851,8 @@ impl TranslatedString {
(Qstr::MP_QSTR_stellar__value_sha256, Self::stellar__value_sha256),
#[cfg(feature = "universal_fw")]
(Qstr::MP_QSTR_stellar__wanna_clean_value_key_template, Self::stellar__wanna_clean_value_key_template),
+ #[cfg(feature = "universal_fw")]
+ (Qstr::MP_QSTR_stellar__wasm_hash, Self::stellar__wasm_hash),
(Qstr::MP_QSTR_storage_msg__processing, Self::storage_msg__processing),
(Qstr::MP_QSTR_storage_msg__starting, Self::storage_msg__starting),
(Qstr::MP_QSTR_storage_msg__verifying_pin, Self::storage_msg__verifying_pin),
### core/embed/upymod/qstrdefsport.h
@@ -486,6 +486,8 @@ Q(NEMModificationType)
Q(NEMMosaicLevy)
Q(NEMSupplyChangeType)
Q(StellarAssetType)
+Q(StellarContractExecutableType)
+Q(StellarContractIDPreimageType)
Q(StellarHostFunctionType)
Q(StellarMemoType)
Q(StellarSCValType)
@@ -814,6 +816,8 @@ Q(trezor.enums.NEMModificationType)
Q(trezor.enums.NEMMosaicLevy)
Q(trezor.enums.NEMSupplyChangeType)
Q(trezor.enums.StellarAssetType)
+Q(trezor.enums.StellarContractExecutableType)
+Q(trezor.enums.StellarContractIDPreimageType)
Q(trezor.enums.StellarHostFunctionType)
Q(trezor.enums.StellarMemoType)
Q(trezor.enums.StellarSCValType)
### core/mocks/trezortranslate_keys.pyi
@@ -943,6 +943,7 @@ class TR:
stellar__delete: str = "Delete"
stellar__delete_passive_offer: str = "Delete Passive Offer"
stellar__delete_trust: str = "Delete trust"
+ stellar__deploy_contract: str = "Deploy contract"
stellar__destination: str = "Destination"
stellar__exchanges_require_memo: str = "Memo is not set. It's typically needed when sending to exchanges."
stellar__ext_auth: str = "External Authorizations"
@@ -995,6 +996,7 @@ class TR:
stellar__valid_until_ledger: str = "Valid until ledger"
stellar__value_sha256: str = "Value (SHA-256)"
stellar__wanna_clean_value_key_template: str = "Do you want to clear value key {0}?"
+ stellar__wasm_hash: str = "Wasm hash"
storage_msg__processing: str = "Processing"
storage_msg__starting: str = "Starting up"
storage_msg__verifying_pin: str = "Verifying PIN"
### core/src/apps/stellar/helpers.py
@@ -83,6 +83,24 @@ def decode_strkey(strkey: str) -> tuple[int, bytes]:
return version, data
+def contract_address_from_address(
+ network_id: AnyBytes, address: str, salt: AnyBytes
+) -> str:
+ """Derive the address (C...) of the contract an address deploys with a salt."""
+ from trezor.crypto.hashlib import sha256
+
+ from .consts import ENVELOPE_TYPE_CONTRACT_ID
+ from .writers import (
+ write_contract_id_preimage_from_address,
+ write_hash_id_preimage_header,
+ )
+
+ w = bytearray()
+ write_hash_id_preimage_header(w, ENVELOPE_TYPE_CONTRACT_ID, network_id)
+ write_contract_id_preimage_from_address(w, address, salt)
+ return encode_strkey(STRKEY_CONTRACT, sha256(w).digest())
+
+
def contract_address_from_asset(network_id: AnyBytes, asset: StellarAsset) -> str:
"""Derive the address (C...) of an asset's Stellar Asset Contract (SAC)."""
from trezor.crypto.hashlib import sha256
### core/src/apps/stellar/layout.py
@@ -17,6 +17,7 @@
from trezor.messages import (
PaymentRequest,
StellarAsset,
+ StellarCreateContractArgsV2,
StellarInt128Parts,
StellarInt256Parts,
StellarInvokeContractArgs,
@@ -540,6 +541,60 @@ async def _confirm_sep41_approve(
)
+async def confirm_create_contract(
+ args: StellarCreateContractArgsV2,
+ network_id: AnyBytes,
+ authorization_title: str | None = None,
+) -> None:
+ """Confirm the creation of a contract, i.e. a deployment.
+
+ The new contract is identified by its address, which is derived from the
+ contract ID preimage (CAP-46-02) and so commits to the deployer and salt.
+ Neither is shown on its own: in Soroban the deployer gains no rights over
+ the contract, and it has to authorize the creation anyway. Then the Wasm
+ the contract runs and the arguments of its constructor are confirmed.
+
+ `authorization_title` is used like in `confirm_invoke_contract`.
+ """
+ from trezor.enums import (
+ StellarContractExecutableType,
+ StellarContractIDPreimageType,
+ )
+
+ from .helpers import contract_address_from_address
+
+ preimage = args.contract_id_preimage
+ executable = args.executable
+ if preimage.type != StellarContractIDPreimageType.CONTRACT_ID_PREIMAGE_FROM_ADDRESS:
+ raise ProcessError("Stellar: unsupported contract ID preimage type")
+ if executable.type != StellarContractExecutableType.CONTRACT_EXECUTABLE_WASM:
+ raise ProcessError("Stellar: unsupported contract executable type")
+ if preimage.from_address is None:
+ raise DataError("Stellar: missing from_address")
+ if executable.wasm_hash is None:
+ raise DataError("Stellar: missing wasm_hash")
+
+ br_name_prefix = "op_create" if authorization_title is None else "op_auth"
+ title = authorization_title or TR.stellar__deploy_contract
+
+ await layouts.confirm_address(
+ title,
+ contract_address_from_address(
+ network_id, preimage.from_address.address, preimage.from_address.salt
+ ),
+ description=TR.stellar__deploy_contract if authorization_title else None,
+ br_name=f"{br_name_prefix}_contract_address",
+ )
+ await layouts.confirm_value(
+ title,
+ executable.wasm_hash.hex(),
+ TR.stellar__wasm_hash,
+ f"{br_name_prefix}_wasm_hash",
+ verb=TR.buttons__continue,
+ )
+ await _confirm_args(args.constructor_args, br_name_prefix, authorization_title)
+
+
async def confirm_authorized_invocation(
invocation: StellarSorobanAuthorizedInvocation,
network_id: AnyBytes,
@@ -573,27 +628,39 @@ async def confirm_invocation(
"""
from trezor.enums import StellarSorobanAuthorizedFunctionType
- func = invocation.function
- if (
- func.type
- != StellarSorobanAuthorizedFunctionType.SOROBAN_AUTHORIZED_FUNCTION_TYPE_CONTRACT_FN
- ):
- raise ProcessError("Stellar: unsupported authorized function type")
- if func.contract_fn is None:
- raise DataError("Stellar: missing contract_fn")
-
if position:
authorization_title = f"{TR.words__authorization} {position}"
else:
authorization_title = TR.words__authorization
- if not is_root:
- await confirm_invoke_contract(
- func.contract_fn,
- network_id,
- authorizing_address,
- authorization_title=authorization_title,
- )
+ func = invocation.function
+ if (
+ func.type
+ == StellarSorobanAuthorizedFunctionType.SOROBAN_AUTHORIZED_FUNCTION_TYPE_CONTRACT_FN
+ ):
+ if func.contract_fn is None:
+ raise DataError("Stellar: missing contract_fn")
+ if not is_root:
+ await confirm_invoke_contract(
+ func.contract_fn,
+ network_id,
+ authorizing_address,
+ authorization_title=authorization_title,
+ )
+ elif (
+ func.type
+ == StellarSorobanAuthorizedFunctionType.SOROBAN_AUTHORIZED_FUNCTION_TYPE_CREATE_CONTRACT_V2_HOST_FN
+ ):
+ if func.create_contract_v2_host_fn is None:
+ raise DataError("Stellar: missing create_contract_v2_host_fn")
+ if not is_root:
+ await confirm_create_contract(
+ func.create_contract_v2_host_fn,
+ network_id,
+ authorization_title=authorization_title,
+ )
+ else:
+ raise ProcessError("Stellar: unsupported authorized function type")
for i, sub in enumerate(invocation.sub_invocations):
await confirm_invocation(
### core/src/apps/stellar/operations/layout.py
@@ -10,7 +10,11 @@
)
from trezor.wire import DataError, ProcessError
-from ..layout import confirm_invocation, confirm_invoke_contract
+from ..layout import (
+ confirm_create_contract,
+ confirm_invocation,
+ confirm_invoke_contract,
+)
from ..tokens import NATIVE_TOKEN, StellarToken
if TYPE_CHECKING:
@@ -447,7 +451,7 @@ def _is_root_auth_entry(
StellarSorobanAuthorizedFunctionType,
)
- from ..writers import write_invoke_contract_args
+ from ..writers import write_create_contract_args_v2, write_invoke_contract_args
auth_fn = auth_entry.root_invocation.function
@@ -462,6 +466,17 @@ def _is_root_auth_entry(
auth_fn.contract_fn,
invoked_fn.invoke_contract,
)
+ if (
+ auth_fn.type
+ == StellarSorobanAuthorizedFunctionType.SOROBAN_AUTHORIZED_FUNCTION_TYPE_CREATE_CONTRACT_V2_HOST_FN
+ and invoked_fn.type
+ == StellarHostFunctionType.HOST_FUNCTION_TYPE_CREATE_CONTRACT_V2
+ ):
+ return _same_xdr(
+ write_create_contract_args_v2,
+ auth_fn.create_contract_v2_host_fn,
+ invoked_fn.create_contract_v2,
+ )
return False
@@ -496,6 +511,11 @@ async def confirm_invoke_host_function_op(
network_id,
source_account,
)
+ elif function.type == StellarHostFunctionType.HOST_FUNCTION_TYPE_CREATE_CONTRACT_V2:
+ if function.create_contract_v2 is None:
+ raise DataError("Stellar: missing create_contract_v2")
+
+ await confirm_create_contract(function.create_contract_v2, network_id)
else:
raise ProcessError("Stellar: unsupported host function type")
### core/src/apps/stellar/operations/serialize.py
@@ -7,6 +7,7 @@
write_asset_code,
write_bool,
write_bytes_fixed,
+ write_create_contract_args_v2,
write_int64,
write_invoke_contract_args,
write_pubkey,
@@ -227,6 +228,10 @@ def _write_host_function(w: Writer, msg: StellarHostFunction) -> None:
if msg.invoke_contract is None:
raise DataError("Stellar: missing invoke_contract")
write_invoke_contract_args(w, msg.invoke_contract)
+ elif msg.type == StellarHostFunctionType.HOST_FUNCTION_TYPE_CREATE_CONTRACT_V2:
+ if msg.create_contract_v2 is None:
+ raise DataError("Stellar: missing create_contract_v2")
+ write_create_contract_args_v2(w, msg.create_contract_v2)
else:
raise ProcessError("Stellar: unsupported host function type")
### core/src/apps/stellar/writers.py
@@ -19,6 +19,9 @@
from trezor.enums import StellarAssetType
from trezor.messages import (
StellarAsset,
+ StellarContractExecutable,
+ StellarContractIDPreimage,
+ StellarCreateContractArgsV2,
StellarInt128Parts,
StellarInt256Parts,
StellarInvokeContractArgs,
@@ -138,6 +141,12 @@ def write_invoke_contract_args(w: Writer, msg: StellarInvokeContractArgs) -> Non
write_vec(w, msg.args, write_sc_val)
+def write_create_contract_args_v2(w: Writer, msg: StellarCreateContractArgsV2) -> None:
+ write_contract_id_preimage(w, msg.contract_id_preimage)
+ write_contract_executable(w, msg.executable)
+ write_vec(w, msg.constructor_args, write_sc_val)
+
+
def write_hash_id_preimage_header(
w: Writer, envelope_type: int, network_id: AnyBytes
) -> None:
@@ -147,6 +156,30 @@ def write_hash_id_preimage_header(
write_bytes_fixed(w, network_id, 32)
+def write_contract_id_preimage(w: Writer, msg: StellarContractIDPreimage) -> None:
+ """Write a ContractIDPreimage, of which only the address variant is supported."""
+ from trezor.enums import StellarContractIDPreimageType
+
+ if msg.type != StellarContractIDPreimageType.CONTRACT_ID_PREIMAGE_FROM_ADDRESS:
+ raise ProcessError("Stellar: unsupported contract ID preimage type")
+ if msg.from_address is None:
+ raise DataError("Stellar: missing from_address")
+ write_contract_id_preimage_from_address(
+ w, msg.from_address.address, msg.from_address.salt
+ )
+
+
+def write_contract_id_preimage_from_address(
+ w: Writer, address: str, salt: AnyBytes
+) -> None:
+ """Write the CONTRACT_ID_PREIMAGE_FROM_ADDRESS variant of ContractIDPreimage."""
+ if len(salt) != 32:
+ raise DataError("Stellar: invalid salt length")
+ write_uint32(w, 0) # CONTRACT_ID_PREIMAGE_FROM_ADDRESS
+ write_sc_address(w, address)
+ write_bytes_fixed(w, salt, 32)
+
+
def write_contract_id_preimage_from_asset(w: Writer, asset: StellarAsset) -> None:
"""Write the CONTRACT_ID_PREIMAGE_FROM_ASSET variant of ContractIDPreimage.
@@ -157,6 +190,19 @@ def write_contract_id_preimage_from_asset(w: Writer, asset: StellarAsset) -> Non
write_asset(w, asset)
+def write_contract_executable(w: Writer, msg: StellarContractExecutable) -> None:
+ from trezor.enums import StellarContractExecutableType
+
+ if msg.type != StellarContractExecutableType.CONTRACT_EXECUTABLE_WASM:
+ raise ProcessError("Stellar: unsupported contract executable type")
+ if msg.wasm_hash is None:
+ raise DataError("Stellar: missing wasm_hash")
+ if len(msg.wasm_hash) != 32:
+ raise DataError("Stellar: invalid wasm_hash length")
+ write_uint32(w, msg.type)
+ write_bytes_fixed(w, msg.wasm_hash, 32)
+
+
def write_sc_address(w: Writer, addr: str) -> None:
from . import helpers
@@ -331,5 +377,12 @@ def _write_soroban_authorized_function(
if msg.contract_fn is None:
raise DataError("Stellar: missing contract_fn")
write_invoke_contract_args(w, msg.contract_fn)
+ elif (
+ msg.type
+ == StellarSorobanAuthorizedFunctionType.SOROBAN_AUTHORIZED_FUNCTION_TYPE_CREATE_CONTRACT_V2_HOST_FN
+ ):
+ if msg.create_contract_v2_host_fn is None:
+ raise DataError("Stellar: missing create_contract_v2_host_fn")
+ write_create_contract_args_v2(w, msg.create_contract_v2_host_fn)
else:
raise ProcessError("Stellar: unsupported authorized function type")
### core/src/trezor/enums/StellarContractExecutableType.py
@@ -0,0 +1,5 @@
+# Automatically generated by pb2py
+# fmt: off
+# isort:skip_file
+
+CONTRACT_EXECUTABLE_WASM = 0
### core/src/trezor/enums/StellarContractIDPreimageType.py
@@ -0,0 +1,5 @@
+# Automatically generated by pb2py
+# fmt: off
+# isort:skip_file
+
+CONTRACT_ID_PREIMAGE_FROM_ADDRESS = 0
### core/src/trezor/enums/StellarHostFunctionType.py
@@ -3,3 +3,4 @@
# isort:skip_file
HOST_FUNCTION_TYPE_INVOKE_CONTRACT = 0
+HOST_FUNCTION_TYPE_CREATE_CONTRACT_V2 = 3
### core/src/trezor/enums/StellarSorobanAuthorizedFunctionType.py
@@ -3,3 +3,4 @@
# isort:skip_file
SOROBAN_AUTHORIZED_FUNCTION_TYPE_CONTRACT_FN = 0
+SOROBAN_AUTHORIZED_FUNCTION_TYPE_CREATE_CONTRACT_V2_HOST_FN = 2
### core/src/trezor/enums/__init__.py
@@ -410,11 +410,19 @@ class StellarSCValType(IntEnum):
SCV_MAP = 17
SCV_ADDRESS = 18
+ class StellarContractIDPreimageType(IntEnum):
+ CONTRACT_ID_PREIMAGE_FROM_ADDRESS = 0
+
+ class StellarContractExecutableType(IntEnum):
+ CONTRACT_EXECUTABLE_WASM = 0
+
class StellarSorobanAuthorizedFunctionType(IntEnum):
SOROBAN_AUTHORIZED_FUNCTION_TYPE_CONTRACT_FN = 0
+ SOROBAN_AUTHORIZED_FUNCTION_TYPE_CREATE_CONTRACT_V2_HOST_FN = 2
class StellarHostFunctionType(IntEnum):
HOST_FUNCTION_TYPE_INVOKE_CONTRACT = 0
+ HOST_FUNCTION_TYPE_CREATE_CONTRACT_V2 = 3
class StellarSorobanCredentialsType(IntEnum):
SOROBAN_CREDENTIALS_SOURCE_ACCOUNT = 0
### core/src/trezor/messages.py
@@ -68,6 +68,8 @@ def __getattr__(name: str) -> Any:
from trezor.enums import SafetyCheckLevel # noqa: F401
from trezor.enums import SdProtectOperationType # noqa: F401
from trezor.enums import StellarAssetType # noqa: F401
+ from trezor.enums import StellarContractExecutableType # noqa: F401
+ from trezor.enums import StellarContractIDPreimageType # noqa: F401
from trezor.enums import StellarHostFunctionType # noqa: F401
from trezor.enums import StellarMemoType # noqa: F401
from trezor.enums import StellarSCValType # noqa: F401
@@ -6687,15 +6689,67 @@ def __init__(
def is_type_of(cls, msg: Any) -> TypeGuard["StellarInvokeContractArgs"]:
return isinstance(msg, cls)
+ class StellarContractIDPreimage(protobuf.MessageType):
+ type: "StellarContractIDPreimageType"
+ from_address: "StellarContractIDPreimageFromAddress | None"
+
+ def __init__(
+ self,
+ *,
+ type: "StellarContractIDPreimageType",
+ from_address: "StellarContractIDPreimageFromAddress | None" = None,
+ ) -> None:
+ pass
+
+ @classmethod
+ def is_type_of(cls, msg: Any) -> TypeGuard["StellarContractIDPreimage"]:
+ return isinstance(msg, cls)
+
+ class StellarContractExecutable(protobuf.MessageType):
+ type: "StellarContractExecutableType"
+ wasm_hash: "AnyBytes | None"
+
+ def __init__(
+ self,
+ *,
+ type: "StellarContractExecutableType",
+ wasm_hash: "AnyBytes | None" = None,
+ ) -> None:
+ pass
+
+ @classmethod
+ def is_type_of(cls, msg: Any) -> TypeGuard["StellarContractExecutable"]:
+ return isinstance(msg, cls)
+
+ class StellarCreateContractArgsV2(protobuf.MessageType):
+ contract_id_preimage: "StellarContractIDPreimage"
+ executable: "StellarContractExecutable"
+ constructor_args: "list[StellarSCVal]"
+
+ def __init__(
+ self,
+ *,
+ contract_id_preimage: "StellarContractIDPreimage",
+ executable: "StellarContractExecutable",
+ constructor_args: "list[StellarSCVal] | None" = None,
+ ) -> None:
+ pass
+
+ @classmethod
+ def is_type_of(cls, msg: Any) -> TypeGuard["StellarCreateContractArgsV2"]:
+ return isinstance(msg, cls)
+
class StellarSorobanAuthorizedFunction(protobuf.MessageType):
type: "StellarSorobanAuthorizedFunctionType"
contract_fn: "StellarInvokeContractArgs | None"
+ create_contract_v2_host_fn: "StellarCreateContractArgsV2 | None"
def __init__(
self,
*,
type: "StellarSorobanAuthorizedFunctionType",
contract_fn: "StellarInvokeContractArgs | None" = None,
+ create_contract_v2_host_fn: "StellarCreateContractArgsV2 | None" = None,
) -> None:
pass
@@ -6722,12 +6776,14 @@ def is_type_of(cls, msg: Any) -> TypeGuard["StellarSorobanAuthorizedInvocation"]
class StellarHostFunction(protobuf.MessageType):
type: "StellarHostFunctionType"
invoke_contract: "StellarInvokeContractArgs | None"
+ create_contract_v2: "StellarCreateContractArgsV2 | None"
def __init__(
self,
*,
type: "StellarHostFunctionType",
invoke_contract: "StellarInvokeContractArgs | None" = None,
+ create_contract_v2: "StellarCreateContractArgsV2 | None" = None,
) -> None:
pass
@@ -6987,6 +7043,22 @@ def __init__(
def is_type_of(cls, msg: Any) -> TypeGuard["StellarSCValMapEntry"]:
return isinstance(msg, cls)
+ class StellarContractIDPreimageFromAddress(protobuf.MessageType):
+ address: "str"
+ salt: "AnyBytes"
+
+ def __init__(
+ self,
+ *,
+ address: "str",
+ salt: "AnyBytes",
+ ) -> None:
+ pass
+
+ @classmethod
+ def is_type_of(cls, msg: Any) -> TypeGuard["StellarContractIDPreimageFromAddress"]:
+ return isinstance(msg, cls)
+
class StellarSorobanAuthorizationWithAddress(protobuf.MessageType):
nonce: "int"
signature_expiration_ledger: "int"
### core/tests/test_apps.stellar.address.py
@@ -19,6 +19,7 @@
STRKEY_LIQUIDITY_POOL,
STRKEY_MUXED_ACCOUNT,
address_from_public_key,
+ contract_address_from_address,
contract_address_from_asset,
decode_strkey,
encode_strkey,
@@ -251,6 +252,47 @@ def test_contract_address_from_asset(self):
network_id = sha256(passphrase.encode()).digest()
self.assertEqual(contract_address_from_asset(network_id, asset), expected)
+ # Expected addresses cross-checked against stellar_sdk (the contract ID
+ # preimage hashed as ENVELOPE_TYPE_CONTRACT_ID of the network).
+ def test_contract_address_from_address(self):
+ salt = bytes(range(32))
+ user = "GAXSFOOGF4ELO5HT5PTN23T5XE6D5QWL3YBHSVQ2HWOFEJNYYMRJENBV"
+ contract = "CABQUEIYD4TC2NB3IJEVAV26MVWHG6UBRCHZNHNEVOZLTQGHZ3K5ZIRI"
+ VECTORS = (
+ (
+ NETWORK_PASSPHRASE_TESTNET,
+ user,
+ salt,
+ "CDJF3R3MMGGPD2IKQXDLE6JKU4FHZDBKHRHHRJQEGDN7274LVTNVEW7M",
+ ),
+ # another salt yields another contract for the same deployer
+ (
+ NETWORK_PASSPHRASE_TESTNET,
+ user,
+ bytes(range(32, 64)),
+ "CC3IGQXG4UJBKFY2REJKX4DVEGRUZ6KBBDXTDFZP72ACXY4TC7CA6BCP",
+ ),
+ # the same preimage yields a different contract on each network
+ (
+ NETWORK_PASSPHRASE_PUBLIC,
+ user,
+ salt,
+ "CCQAZWSDF67IIKGEB543CJTX4VVYFHFSXJ7VKIULYDM5Y54PXO3OW77H",
+ ),
+ # a contract can be the deployer too
+ (
+ NETWORK_PASSPHRASE_TESTNET,
+ contract,
+ salt,
+ "CCUMNRWWUAA5YSVTVCTOMNNKCJYZ74SZ3VUOHX7NU3YHAEBF242QNRR4",
+ ),
+ )
+ for passphrase, deployer, salt, expected in VECTORS:
+ network_id = sha256(passphrase.encode()).digest()
+ self.assertEqual(
+ contract_address_from_address(network_id, deployer, salt), expected
+ )
+
if __name__ == "__main__":
unittest.main()
### core/tests/test_apps.stellar.layout.py
@@ -3,12 +3,18 @@
if not utils.BITCOIN_ONLY:
from trezor.enums import (
+ StellarContractExecutableType,
+ StellarContractIDPreimageType,
StellarHostFunctionType,
StellarSCValType,
StellarSorobanAuthorizedFunctionType,
StellarSorobanCredentialsType,
)
from trezor.messages import (
+ StellarContractExecutable,
+ StellarContractIDPreimage,
+ StellarContractIDPreimageFromAddress,
+ StellarCreateContractArgsV2,
StellarHostFunction,
StellarInt128Parts,
StellarInt256Parts,
@@ -383,6 +389,94 @@ def test_is_root_auth_entry(self):
)
self.assertEqual(_is_root_auth_entry(auth_entry, invoked), is_root)
+ def test_is_root_auth_entry_create_contract(self):
+ salt = bytes(range(32))
+ wasm_hash = bytes(range(32, 64))
+
+ def create_args(
+ address=_ACCOUNT_A, salt=salt, wasm_hash=wasm_hash, constructor_args=()
+ ):
+ return StellarCreateContractArgsV2(
+ contract_id_preimage=StellarContractIDPreimage(
+ type=StellarContractIDPreimageType.CONTRACT_ID_PREIMAGE_FROM_ADDRESS,
+ from_address=StellarContractIDPreimageFromAddress(
+ address=address, salt=salt
+ ),
+ ),
+ executable=StellarContractExecutable(
+ type=StellarContractExecutableType.CONTRACT_EXECUTABLE_WASM,
+ wasm_hash=wasm_hash,
+ ),
+ constructor_args=list(constructor_args),
+ )
+
+ def source_entry(function):
+ return StellarSorobanAuthorizationEntry(
+ credentials=StellarSorobanCredentials(
+ type=StellarSorobanCredentialsType.SOROBAN_CREDENTIALS_SOURCE_ACCOUNT
+ ),
+ root_invocation=StellarSorobanAuthorizedInvocation(
+ function=function, sub_invocations=[]
+ ),
+ )
+
+ def create_fn(args):
+ return StellarSorobanAuthorizedFunction(
+ type=StellarSorobanAuthorizedFunctionType.SOROBAN_AUTHORIZED_FUNCTION_TYPE_CREATE_CONTRACT_V2_HOST_FN,
+ create_contract_v2_host_fn=args,
+ )
+
+ invoked = StellarHostFunction(
+ type=StellarHostFunctionType.HOST_FUNCTION_TYPE_CREATE_CONTRACT_V2,
+ create_contract_v2=create_args(constructor_args=[_u32(1)]),
+ )
+
+ TESTS = [
+ (create_args(constructor_args=[_u32(1)]), True), # identical
+ (create_args(address=_ACCOUNT_B, constructor_args=[_u32(1)]), False),
+ (create_args(salt=bytes(32), constructor_args=[_u32(1)]), False),
+ (create_args(wasm_hash=bytes(32), constructor_args=[_u32(1)]), False),
+ (create_args(constructor_args=[_u32(2)]), False), # different arg value
+ (create_args(constructor_args=[_u64(1)]), False), # different arg type
+ (create_args(constructor_args=[_u32(1), _u32(1)]), False), # extra arg
+ (create_args(), False), # missing arg
+ ]
+ for args, is_root in TESTS:
+ self.assertEqual(
+ _is_root_auth_entry(source_entry(create_fn(args)), invoked), is_root
+ )
+
+ # a contract call and a contract creation never match each other
+ call = StellarInvokeContractArgs(
+ contract_address=_CONTRACT_A, function_name="deploy", args=[_u32(1)]
+ )
+ invoked_call = StellarHostFunction(
+ type=StellarHostFunctionType.HOST_FUNCTION_TYPE_INVOKE_CONTRACT,
+ invoke_contract=call,
+ )
+ call_fn = StellarSorobanAuthorizedFunction(
+ type=StellarSorobanAuthorizedFunctionType.SOROBAN_AUTHORIZED_FUNCTION_TYPE_CONTRACT_FN,
+ contract_fn=call,
+ )
+ creation = create_fn(create_args(constructor_args=[_u32(1)]))
+ self.assertFalse(_is_root_auth_entry(source_entry(creation), invoked_call))
+ self.assertFalse(_is_root_auth_entry(source_entry(call_fn), invoked))
+
+ # a creation missing on either side never matches
+ no_creation_fn = StellarSorobanAuthorizedFunction(
+ type=StellarSorobanAuthorizedFunctionType.SOROBAN_AUTHORIZED_FUNCTION_TYPE_CREATE_CONTRACT_V2_HOST_FN
+ )
+ no_creation_invoked = StellarHostFunction(
+ type=StellarHostFunctionType.HOST_FUNCTION_TYPE_CREATE_CONTRACT_V2
+ )
+ self.assertFalse(_is_root_auth_entry(source_entry(no_creation_fn), invoked))
+ self.assertFalse(
+ _is_root_auth_entry(source_entry(creation), no_creation_invoked)
+ )
+ self.assertFalse(
+ _is_root_auth_entry(source_entry(no_creation_fn), no_creation_invoked)
+ )
+
if __name__ == "__main__":
unittest.main()
### core/translations/en.json
@@ -2855,6 +2855,7 @@
"stellar__delete": "Delete",
"stellar__delete_passive_offer": "Delete Passive Offer",
"stellar__delete_trust": "Delete trust",
+ "stellar__deploy_contract": "Deploy contract",
"stellar__destination": "Destination",
"stellar__exchanges_require_memo": "Memo is not set. It's typically needed when sending to exchanges.",
"stellar__ext_auth": "External Authorizations",
@@ -2907,6 +2908,7 @@
"stellar__valid_until_ledger": "Valid until ledger",
"stellar__value_sha256": "Value (SHA-256)",
"stellar__wanna_clean_value_key_template": "Do you want to clear value key {0}?",
+ "stellar__wasm_hash": "Wasm hash",
"storage_msg__processing": {
"Bolt": "Processing",
"Caesar": "Processing",
### core/translations/order.json
@@ -1295,5 +1295,7 @@
"1293": "words__undelegate",
"1294": "buttons__review",
"1295": "buttons__cancel_sign",
- "1296": "address__title_multisig_xpub_template"
+ "1296": "address__title_multisig_xpub_template",
+ "1297": "stellar__deploy_contract",
+ "1298": "stellar__wasm_hash"
}
### core/translations/signatures.json
@@ -1,8 +1,8 @@
{
"current": {
- "merkle_root": "555af5ef0e8212359f75f94b53357dc8bb7ebcc8231859e38326fd8edfac431a",
- "datetime": "2026-09-21T14:16:33.405107+00:00",
- "commit": "80c621ed0b87dcaf65804d1a72e81385deed8fc7"
+ "merkle_root": "eec378081a873899f8300ca184662e313d8e13192c8c042f66f6c7f25b14e237",
+ "datetime": "2026-09-22T08:55:38.045852+00:00",
+ "commit": "1c4cb295fdc33057ab90e27c6af314cd3c5f2b86"
},
"history": [
{
### python/.changelog.d/7313.added
@@ -0,0 +1 @@
+Stellar: Support creating contracts.
### python/src/trezorlib/messages.py
@@ -466,12 +466,22 @@ class StellarSCValType(IntEnum):
SCV_ADDRESS = 18
+class StellarContractIDPreimageType(IntEnum):
+ CONTRACT_ID_PREIMAGE_FROM_ADDRESS = 0
+
+
+class StellarContractExecutableType(IntEnum):
+ CONTRACT_EXECUTABLE_WASM = 0
+
+
class StellarSorobanAuthorizedFunctionType(IntEnum):
SOROBAN_AUTHORIZED_FUNCTION_TYPE_CONTRACT_FN = 0
+ SOROBAN_AUTHORIZED_FUNCTION_TYPE_CREATE_CONTRACT_V2_HOST_FN = 2
class StellarHostFunctionType(IntEnum):
HOST_FUNCTION_TYPE_INVOKE_CONTRACT = 0
+ HOST_FUNCTION_TYPE_CREATE_CONTRACT_V2 = 3
class StellarSorobanCredentialsType(IntEnum):
@@ -8605,21 +8615,78 @@ def __init__(
self.asset_hint = asset_hint
+class StellarContractIDPreimage(protobuf.MessageType):
+ MESSAGE_WIRE_TYPE = None
+ FIELDS = {
+ 1: protobuf.Field("type", "StellarContractIDPreimageType", repeated=False, required=True),
+ 2: protobuf.Field("from_address", "StellarContractIDPreimageFromAddress", repeated=False, required=False, default=None),
+ }
+
+ def __init__(
+ self,
+ *,
+ type: "StellarContractIDPreimageType",
+ from_address: Optional["StellarContractIDPreimageFromAddress"] = None,
+ ) -> None:
+ self.type = type
+ self.from_address = from_address
+
+
+class StellarContractExecutable(protobuf.MessageType):
+ MESSAGE_WIRE_TYPE = None
+ FIELDS = {
+ 1: protobuf.Field("type", "StellarContractExecutableType", repeated=False, required=True),
+ 2: protobuf.Field("wasm_hash", "bytes", repeated=False, required=False, default=None),
+ }
+
+ def __init__(
+ self,
+ *,
+ type: "StellarContractExecutableType",
+ wasm_hash: Optional["bytes"] = None,
+ ) -> None:
+ self.type = type
+ self.wasm_hash = wasm_hash
+
+
+class StellarCreateContractArgsV2(protobuf.MessageType):
+ MESSAGE_WIRE_TYPE = None
+ FIELDS = {
+ 1: protobuf.Field("contract_id_preimage", "StellarContractIDPreimage", repeated=False, required=True),
+ 2: protobuf.Field("executable", "StellarContractExecutable", repeated=False, required=True),
+ 3: protobuf.Field("constructor_args", "StellarSCVal", repeated=True, required=False, default=None),
+ }
+
+ def __init__(
+ self,
+ *,
+ contract_id_preimage: "StellarContractIDPreimage",
+ executable: "StellarContractExecutable",
+ constructor_args: Optional[Sequence["StellarSCVal"]] = None,
+ ) -> None:
+ self.constructor_args: Sequence["StellarSCVal"] = constructor_args if constructor_args is not None else []
+ self.contract_id_preimage = contract_id_preimage
+ self.executable = executable
+
+
class StellarSorobanAuthorizedFunction(protobuf.MessageType):
MESSAGE_WIRE_TYPE = None
FIELDS = {
1: protobuf.Field("type", "StellarSorobanAuthorizedFunctionType", repeated=False, required=True),
2: protobuf.Field("contract_fn", "StellarInvokeContractArgs", repeated=False, required=False, default=None),
+ 3: protobuf.Field("create_contract_v2_host_fn", "StellarCreateContractArgsV2", repeated=False, required=False, default=None),
}
def __init__(
self,
*,
type: "StellarSorobanAuthorizedFunctionType",
contract_fn: Optional["StellarInvokeContractArgs"] = None,
+ create_contract_v2_host_fn: Optional["StellarCreateContractArgsV2"] = None,
) -> None:
self.type = type
self.contract_fn = contract_fn
+ self.create_contract_v2_host_fn = create_contract_v2_host_fn
class StellarSorobanAuthorizedInvocation(protobuf.MessageType):
@@ -8644,16 +8711,19 @@ class StellarHostFunction(protobuf.MessageType):
FIELDS = {
1: protobuf.Field("type", "StellarHostFunctionType", repeated=False, required=True),
2: protobuf.Field("invoke_contract", "StellarInvokeContractArgs", repeated=False, required=False, default=None),
+ 3: protobuf.Field("create_contract_v2", "StellarCreateContractArgsV2", repeated=False, required=False, default=None),
}
def __init__(
self,
*,
type: "StellarHostFunctionType",
invoke_contract: Optional["StellarInvokeContractArgs"] = None,
+ create_contract_v2: Optional["StellarCreateContractArgsV2"] = None,
) -> None:
self.type = type
self.invoke_contract = invoke_contract
+ self.create_contract_v2 = create_contract_v2
class StellarSorobanAddressCredentials(protobuf.MessageType):
@@ -8931,6 +9001,23 @@ def __init__(
self.value = value
+class StellarContractIDPreimageFromAddress(protobuf.MessageType):
+ MESSAGE_WIRE_TYPE = None
+ FIELDS = {
+ 1: protobuf.Field("address", "string", repeated=False, required=True),
+ 2: protobuf.Field("salt", "bytes", repeated=False, required=True),
+ }
+
+ def __init__(
+ self,
+ *,
+ address: "str",
+ salt: "bytes",
+ ) -> None:
+ self.address = address
+ self.salt = salt
+
+
class StellarSorobanAuthorizationWithAddress(protobuf.MessageType):
MESSAGE_WIRE_TYPE = None
FIELDS = {
### python/src/trezorlib/stellar_sdk_helpers.py
@@ -570,6 +570,48 @@ def _read_invoke_contract_args(
)
+def _read_contract_id_preimage(
+ preimage: xdr.ContractIDPreimage,
+) -> messages.StellarContractIDPreimage:
+ """Read ContractIDPreimage from XDR."""
+ if preimage.type == xdr.ContractIDPreimageType.CONTRACT_ID_PREIMAGE_FROM_ADDRESS:
+ assert preimage.from_address is not None
+ return messages.StellarContractIDPreimage(
+ type=messages.StellarContractIDPreimageType.CONTRACT_ID_PREIMAGE_FROM_ADDRESS,
+ from_address=messages.StellarContractIDPreimageFromAddress(
+ address=_read_sc_address(preimage.from_address.address),
+ salt=preimage.from_address.salt.uint256,
+ ),
+ )
+ else:
+ raise ValueError(f"Unsupported ContractIDPreimage type: {preimage.type}")
+
+
+def _read_contract_executable(
+ executable: xdr.ContractExecutable,
+) -> messages.StellarContractExecutable:
+ """Read ContractExecutable from XDR."""
+ if executable.type == xdr.ContractExecutableType.CONTRACT_EXECUTABLE_WASM:
+ assert executable.wasm_hash is not None
+ return messages.StellarContractExecutable(
+ type=messages.StellarContractExecutableType.CONTRACT_EXECUTABLE_WASM,
+ wasm_hash=executable.wasm_hash.hash,
+ )
+ else:
+ raise ValueError(f"Unsupported ContractExecutable type: {executable.type}")
+
+
+def _read_create_contract_args_v2(
+ args: xdr.CreateContractArgsV2,
+) -> messages.StellarCreateContractArgsV2:
+ """Read CreateContractArgsV2 from XDR."""
+ return messages.StellarCreateContractArgsV2(
+ contract_id_preimage=_read_contract_id_preimage(args.contract_id_preimage),
+ executable=_read_contract_executable(args.executable),
+ constructor_args=[_read_sc_val(arg) for arg in args.constructor_args],
+ )
+
+
def _read_authorized_function(
function: xdr.SorobanAuthorizedFunction,
) -> messages.StellarSorobanAuthorizedFunction:
@@ -583,6 +625,17 @@ def _read_authorized_function(
type=messages.StellarSorobanAuthorizedFunctionType.SOROBAN_AUTHORIZED_FUNCTION_TYPE_CONTRACT_FN,
contract_fn=_read_invoke_contract_args(function.contract_fn),
)
+ elif (
+ function.type
+ == xdr.SorobanAuthorizedFunctionType.SOROBAN_AUTHORIZED_FUNCTION_TYPE_CREATE_CONTRACT_V2_HOST_FN
+ ):
+ assert function.create_contract_v2_host_fn is not None
+ return messages.StellarSorobanAuthorizedFunction(
+ type=messages.StellarSorobanAuthorizedFunctionType.SOROBAN_AUTHORIZED_FUNCTION_TYPE_CREATE_CONTRACT_V2_HOST_FN,
+ create_contract_v2_host_fn=_read_create_contract_args_v2(
+ function.create_contract_v2_host_fn
+ ),
+ )
else:
raise ValueError(f"Unsupported SorobanAuthorizedFunction type: {function.type}")
@@ -689,11 +742,21 @@ def _read_host_function(
host_function: xdr.HostFunction,
) -> messages.StellarHostFunction:
"""Read HostFunction from XDR."""
- if host_function.type != xdr.HostFunctionType.HOST_FUNCTION_TYPE_INVOKE_CONTRACT:
+ if host_function.type == xdr.HostFunctionType.HOST_FUNCTION_TYPE_INVOKE_CONTRACT:
+ assert host_function.invoke_contract is not None
+ return messages.StellarHostFunction(
+ type=messages.StellarHostFunctionType.HOST_FUNCTION_TYPE_INVOKE_CONTRACT,
+ invoke_contract=_read_invoke_contract_args(host_function.invoke_contract),
+ )
+ elif (
+ host_function.type == xdr.HostFunctionType.HOST_FUNCTION_TYPE_CREATE_CONTRACT_V2
+ ):
+ assert host_function.create_contract_v2 is not None
+ return messages.StellarHostFunction(
+ type=messages.StellarHostFunctionType.HOST_FUNCTION_TYPE_CREATE_CONTRACT_V2,
+ create_contract_v2=_read_create_contract_args_v2(
+ host_function.create_contract_v2
+ ),
+ )
+ else:
raise ValueError(f"Unsupported host function type: {host_function.type}")
-
- assert host_function.invoke_contract is not None
- return messages.StellarHostFunction(
- type=messages.StellarHostFunctionType.HOST_FUNCTION_TYPE_INVOKE_CONTRACT,
- invoke_contract=_read_invoke_contract_args(host_function.invoke_contract),
- )
### python/tests/test_stellar.py
@@ -1367,3 +1367,142 @@ def test_from_authorization_entry_hints_require_network_passphrase():
# an exhausted iterator carries no hints, so no passphrase is needed
from_authorization_entry(entry, asset_hints=iter(()))
+
+
+CREATE_WASM_HASH = bytes(range(32))
+CREATE_SALT = bytes(range(32, 64))
+
+
+def make_create_contract_args(preimage=None, executable=None):
+ """CreateContractArgsV2 deploying a Wasm contract on behalf of the source."""
+ if preimage is None:
+ preimage = stellar_xdr.ContractIDPreimage(
+ type=stellar_xdr.ContractIDPreimageType.CONTRACT_ID_PREIMAGE_FROM_ADDRESS,
+ from_address=stellar_xdr.ContractIDPreimageFromAddress(
+ address=Address(SOROBAN_SOURCE).to_xdr_sc_address(),
+ salt=stellar_xdr.Uint256(CREATE_SALT),
+ ),
+ )
+ if executable is None:
+ executable = stellar_xdr.ContractExecutable(
+ type=stellar_xdr.ContractExecutableType.CONTRACT_EXECUTABLE_WASM,
+ wasm_hash=stellar_xdr.Hash(CREATE_WASM_HASH),
+ )
+ return stellar_xdr.CreateContractArgsV2(
+ contract_id_preimage=preimage,
+ executable=executable,
+ constructor_args=[scval.to_address(SOROBAN_DESTINATION), scval.to_uint32(7)],
+ )
+
+
+EXPECTED_CREATE_CONTRACT_ARGS = messages.StellarCreateContractArgsV2(
+ contract_id_preimage=messages.StellarContractIDPreimage(
+ type=messages.StellarContractIDPreimageType.CONTRACT_ID_PREIMAGE_FROM_ADDRESS,
+ from_address=messages.StellarContractIDPreimageFromAddress(
+ address=SOROBAN_SOURCE, salt=CREATE_SALT
+ ),
+ ),
+ executable=messages.StellarContractExecutable(
+ type=messages.StellarContractExecutableType.CONTRACT_EXECUTABLE_WASM,
+ wasm_hash=CREATE_WASM_HASH,
+ ),
+ constructor_args=[
+ messages.StellarSCVal(
+ type=messages.StellarSCValType.SCV_ADDRESS, address=SOROBAN_DESTINATION
+ ),
+ messages.StellarSCVal(type=messages.StellarSCValType.SCV_U32, u32=7),
+ ],
+)
+
+
+def make_create_contract_tx(args, auth=()):
+ """A transaction creating a contract with the given CreateContractArgsV2."""
+ op = InvokeHostFunction(
+ host_function=stellar_xdr.HostFunction(
+ type=stellar_xdr.HostFunctionType.HOST_FUNCTION_TYPE_CREATE_CONTRACT_V2,
+ create_contract_v2=args,
+ ),
+ auth=list(auth),
+ )
+ return make_default_tx().append_operation(op).build()
+
+
+def test_from_envelope_create_contract():
+ args = make_create_contract_args()
+ # the source account authorizes its own deployment
+ entry = stellar_xdr.SorobanAuthorizationEntry(
+ credentials=stellar_xdr.SorobanCredentials(
+ type=stellar_xdr.SorobanCredentialsType.SOROBAN_CREDENTIALS_SOURCE_ACCOUNT
+ ),
+ root_invocation=stellar_xdr.SorobanAuthorizedInvocation(
+ function=stellar_xdr.SorobanAuthorizedFunction(
+ type=stellar_xdr.SorobanAuthorizedFunctionType.SOROBAN_AUTHORIZED_FUNCTION_TYPE_CREATE_CONTRACT_V2_HOST_FN,
+ create_contract_v2_host_fn=args,
+ ),
+ sub_invocations=[],
+ ),
+ )
+
+ _, operations, _ = from_envelope(make_create_contract_tx(args, [entry]))
+
+ op = operations[0]
+ assert op.function == messages.StellarHostFunction(
+ type=messages.StellarHostFunctionType.HOST_FUNCTION_TYPE_CREATE_CONTRACT_V2,
+ create_contract_v2=EXPECTED_CREATE_CONTRACT_ARGS,
+ )
+ assert op.auth[0].root_invocation.function == (
+ messages.StellarSorobanAuthorizedFunction(
+ type=messages.StellarSorobanAuthorizedFunctionType.SOROBAN_AUTHORIZED_FUNCTION_TYPE_CREATE_CONTRACT_V2_HOST_FN,
+ create_contract_v2_host_fn=EXPECTED_CREATE_CONTRACT_ARGS,
+ )
+ )
+
+
+def test_from_envelope_unsupported_contract_creation():
+ # deploying the Stellar Asset Contract of an asset
+ from_asset = stellar_xdr.ContractIDPreimage(
+ type=stellar_xdr.ContractIDPreimageType.CONTRACT_ID_PREIMAGE_FROM_ASSET,
+ from_asset=SAC_ASSET.to_xdr_object(),
+ )
+ with pytest.raises(ValueError, match="Unsupported ContractIDPreimage type"):
+ from_envelope(
+ make_create_contract_tx(make_create_contract_args(preimage=from_asset))
+ )
+
+ stellar_asset = stellar_xdr.ContractExecutable(
+ type=stellar_xdr.ContractExecutableType.CONTRACT_EXECUTABLE_STELLAR_ASSET
+ )
+ with pytest.raises(ValueError, match="Unsupported ContractExecutable type"):
+ from_envelope(
+ make_create_contract_tx(make_create_contract_args(executable=stellar_asset))
+ )
+
+ # the legacy creation without constructor arguments
+ v2_args = make_create_contract_args()
+ legacy = stellar_xdr.CreateContractArgs(
+ v2_args.contract_id_preimage, v2_args.executable
+ )
+ legacy_op = InvokeHostFunction(
+ host_function=stellar_xdr.HostFunction(
+ type=stellar_xdr.HostFunctionType.HOST_FUNCTION_TYPE_CREATE_CONTRACT,
+ create_contract=legacy,
+ ),
+ auth=[],
+ )
+ with pytest.raises(ValueError, match="Unsupported host function type"):
+ from_envelope(make_default_tx().append_operation(legacy_op).build())
+
+ entry = stellar_xdr.SorobanAuthorizationEntry(
+ credentials=stellar_xdr.SorobanCredentials(
+ type=stellar_xdr.SorobanCredentialsType.SOROBAN_CREDENTIALS_SOURCE_ACCOUNT
+ ),
+ root_invocation=stellar_xdr.SorobanAuthorizedInvocation(
+ function=stellar_xdr.SorobanAuthorizedFunction(
+ type=stellar_xdr.SorobanAuthorizedFunctionType.SOROBAN_AUTHORIZED_FUNCTION_TYPE_CREATE_CONTRACT_HOST_FN,
+ create_contract_host_fn=legacy,
+ ),
+ sub_invocations=[],
+ ),
+ )
+ with pytest.raises(ValueError, match="Unsupported SorobanAuthorizedFunction type"):
+ from_envelope(make_sac_transfer_tx(auth=[entry]))
### rust/trezor-client/src/protos/generated/messages_stellar.rs
@@ -8517,6 +8517,898 @@ impl ::protobuf::reflect::ProtobufValue for StellarInvokeContractArgs {
type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage<Self>;
}
+// @@protoc_insertion_point(message:hw.trezor.messages.stellar.StellarContractIDPreimage)
+#[derive(PartialEq,Clone,Default,Debug)]
+pub struct StellarContractIDPreimage {
+ // message fields
+ // @@protoc_insertion_point(field:hw.trezor.messages.stellar.StellarContractIDPreimage.type)
+ pub type_: ::std::option::Option<::protobuf::EnumOrUnknown<stellar_contract_idpreimage::StellarContractIDPreimageType>>,
+ // @@protoc_insertion_point(field:hw.trezor.messages.stellar.StellarContractIDPreimage.from_address)
+ pub from_address: ::protobuf::MessageField<stellar_contract_idpreimage::StellarContractIDPreimageFromAddress>,
+ // special fields
+ // @@protoc_insertion_point(special_field:hw.trezor.messages.stellar.StellarContractIDPreimage.special_fields)
+ pub special_fields: ::protobuf::SpecialFields,
+}
+
+impl<'a> ::std::default::Default for &'a StellarContractIDPreimage {
+ fn default() -> &'a StellarContractIDPreimage {
+ <StellarContractIDPreimage as ::protobuf::Message>::default_instance()
+ }
+}
+
+impl StellarContractIDPreimage {
+ pub fn new() -> StellarContractIDPreimage {
+ ::std::default::Default::default()
+ }
+
+ // required .hw.trezor.messages.stellar.StellarContractIDPreimage.StellarContractIDPreimageType type = 1;
+
+ pub fn type_(&self) -> stellar_contract_idpreimage::StellarContractIDPreimageType {
+ match self.type_ {
+ Some(e) => e.enum_value_or(stellar_contract_idpreimage::StellarContractIDPreimageType::CONTRACT_ID_PREIMAGE_FROM_ADDRESS),
+ None => stellar_contract_idpreimage::StellarContractIDPreimageType::CONTRACT_ID_PREIMAGE_FROM_ADDRESS,
+ }
+ }
+
+ pub fn clear_type_(&mut self) {
+ self.type_ = ::std::option::Option::None;
+ }
+
+ pub fn has_type(&self) -> bool {
+ self.type_.is_some()
+ }
+
+ // Param is passed by value, moved
+ pub fn set_type(&mut self, v: stellar_contract_idpreimage::StellarContractIDPreimageType) {
+ self.type_ = ::std::option::Option::Some(::protobuf::EnumOrUnknown::new(v));
+ }
+
+ fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData {
+ let mut fields = ::std::vec::Vec::with_capacity(2);
+ let mut oneofs = ::std::vec::Vec::with_capacity(0);
+ fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>(
+ "type",
+ |m: &StellarContractIDPreimage| { &m.type_ },
+ |m: &mut StellarContractIDPreimage| { &mut m.type_ },
+ ));
+ fields.push(::protobuf::reflect::rt::v2::make_message_field_accessor::<_, stellar_contract_idpreimage::StellarContractIDPreimageFromAddress>(
+ "from_address",
+ |m: &StellarContractIDPreimage| { &m.from_address },
+ |m: &mut StellarContractIDPreimage| { &mut m.from_address },
+ ));
+ ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::<StellarContractIDPreimage>(
+ "StellarContractIDPreimage",
+ fields,
+ oneofs,
+ )
+ }
+}
+
+impl ::protobuf::Message for StellarContractIDPreimage {
+ const NAME: &'static str = "StellarContractIDPreimage";
+
+ fn is_initialized(&self) -> bool {
+ if self.type_.is_none() {
+ return false;
+ }
+ for v in &self.from_address {
+ if !v.is_initialized() {
+ return false;
+ }
+ };
+ true
+ }
+
+ fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::Result<()> {
+ while let Some(tag) = is.read_raw_tag_or_eof()? {
+ match tag {
+ 8 => {
+ self.type_ = ::std::option::Option::Some(is.read_enum_or_unknown()?);
+ },
+ 18 => {
+ ::protobuf::rt::read_singular_message_into_field(is, &mut self.from_address)?;
+ },
+ tag => {
+ ::protobuf::rt::read_unknown_or_skip_group(tag, is, self.special_fields.mut_unknown_fields())?;
+ },
+ };
+ }
+ ::std::result::Result::Ok(())
+ }
+
+ // Compute sizes of nested messages
+ #[allow(unused_variables)]
+ fn compute_size(&self) -> u64 {
+ let mut my_size = 0;
+ if let Some(v) = self.type_ {
+ my_size += ::protobuf::rt::int32_size(1, v.value());
+ }
+ if let Some(v) = self.from_address.as_ref() {
+ let len = v.compute_size();
+ my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len;
+ }
+ my_size += ::protobuf::rt::unknown_fields_size(self.special_fields.unknown_fields());
+ self.special_fields.cached_size().set(my_size as u32);
+ my_size
+ }
+
+ fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::Result<()> {
+ if let Some(v) = self.type_ {
+ os.write_enum(1, ::protobuf::EnumOrUnknown::value(&v))?;
+ }
+ if let Some(v) = self.from_address.as_ref() {
+ ::protobuf::rt::write_message_field_with_cached_size(2, v, os)?;
+ }
+ os.write_unknown_fields(self.special_fields.unknown_fields())?;
+ ::std::result::Result::Ok(())
+ }
+
+ fn special_fields(&self) -> &::protobuf::SpecialFields {
+ &self.special_fields
+ }
+
+ fn mut_special_fields(&mut self) -> &mut ::protobuf::SpecialFields {
+ &mut self.special_fields
+ }
+
+ fn new() -> StellarContractIDPreimage {
+ StellarContractIDPreimage::new()
+ }
+
+ fn clear(&mut self) {
+ self.type_ = ::std::option::Option::None;
+ self.from_address.clear();
+ self.special_fields.clear();
+ }
+
+ fn default_instance() -> &'static StellarContractIDPreimage {
+ static instance: StellarContractIDPreimage = StellarContractIDPreimage {
+ type_: ::std::option::Option::None,
+ from_address: ::protobuf::MessageField::none(),
+ special_fields: ::protobuf::SpecialFields::new(),
+ };
+ &instance
+ }
+}
+
+impl ::protobuf::MessageFull for StellarContractIDPreimage {
+ fn descriptor() -> ::protobuf::reflect::MessageDescriptor {
+ static descriptor: ::protobuf::rt::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::Lazy::new();
+ descriptor.get(|| file_descriptor().message_by_package_relative_name("StellarContractIDPreimage").unwrap()).clone()
+ }
+}
+
+impl ::std::fmt::Display for StellarContractIDPreimage {
+ fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
+ ::protobuf::text_format::fmt(self, f)
+ }
+}
+
+impl ::protobuf::reflect::ProtobufValue for StellarContractIDPreimage {
+ type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage<Self>;
+}
+
+/// Nested message and enums of message `StellarContractIDPreimage`
+pub mod stellar_contract_idpreimage {
+ // @@protoc_insertion_point(message:hw.trezor.messages.stellar.StellarContractIDPreimage.StellarContractIDPreimageFromAddress)
+ #[derive(PartialEq,Clone,Default,Debug)]
+ pub struct StellarContractIDPreimageFromAddress {
+ // message fields
+ // @@protoc_insertion_point(field:hw.trezor.messages.stellar.StellarContractIDPreimage.StellarContractIDPreimageFromAddress.address)
+ pub address: ::std::option::Option<::std::string::String>,
+ // @@protoc_insertion_point(field:hw.trezor.messages.stellar.StellarContractIDPreimage.StellarContractIDPreimageFromAddress.salt)
+ pub salt: ::std::option::Option<::std::vec::Vec<u8>>,
+ // special fields
+ // @@protoc_insertion_point(special_field:hw.trezor.messages.stellar.StellarContractIDPreimage.StellarContractIDPreimageFromAddress.special_fields)
+ pub special_fields: ::protobuf::SpecialFields,
+ }
+
+ impl<'a> ::std::default::Default for &'a StellarContractIDPreimageFromAddress {
+ fn default() -> &'a StellarContractIDPreimageFromAddress {
+ <StellarContractIDPreimageFromAddress as ::protobuf::Message>::default_instance()
+ }
+ }
+
+ impl StellarContractIDPreimageFromAddress {
+ pub fn new() -> StellarContractIDPreimageFromAddress {
+ ::std::default::Default::default()
+ }
+
+ // required string address = 1;
+
+ pub fn address(&self) -> &str {
+ match self.address.as_ref() {
+ Some(v) => v,
+ None => "",
+ }
+ }
+
+ pub fn clear_address(&mut self) {
+ self.address = ::std::option::Option::None;
+ }
+
+ pub fn has_address(&self) -> bool {
+ self.address.is_some()
+ }
+
+ // Param is passed by value, moved
+ pub fn set_address(&mut self, v: ::std::string::String) {
+ self.address = ::std::option::Option::Some(v);
+ }
+
+ // Mutable pointer to the field.
+ // If field is not initialized, it is initialized with default value first.
+ pub fn mut_address(&mut self) -> &mut ::std::string::String {
+ if self.address.is_none() {
+ self.address = ::std::option::Option::Some(::std::string::String::new());
+ }
+ self.address.as_mut().unwrap()
+ }
+
+ // Take field
+ pub fn take_address(&mut self) -> ::std::string::String {
+ self.address.take().unwrap_or_else(|| ::std::string::String::new())
+ }
+
+ // required bytes salt = 2;
+
+ pub fn salt(&self) -> &[u8] {
+ match self.salt.as_ref() {
+ Some(v) => v,
+ None => &[],
+ }
+ }
+
+ pub fn clear_salt(&mut self) {
+ self.salt = ::std::option::Option::None;
+ }
+
+ pub fn has_salt(&self) -> bool {
+ self.salt.is_some()
+ }
+
+ // Param is passed by value, moved
+ pub fn set_salt(&mut self, v: ::std::vec::Vec<u8>) {
+ self.salt = ::std::option::Option::Some(v);
+ }
+
+ // Mutable pointer to the field.
+ // If field is not initialized, it is initialized with default value first.
+ pub fn mut_salt(&mut self) -> &mut ::std::vec::Vec<u8> {
+ if self.salt.is_none() {
+ self.salt = ::std::option::Option::Some(::std::vec::Vec::new());
+ }
+ self.salt.as_mut().unwrap()
+ }
+
+ // Take field
+ pub fn take_salt(&mut self) -> ::std::vec::Vec<u8> {
+ self.salt.take().unwrap_or_else(|| ::std::vec::Vec::new())
+ }
+
+ pub(in super) fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData {
+ let mut fields = ::std::vec::Vec::with_capacity(2);
+ let mut oneofs = ::std::vec::Vec::with_capacity(0);
+ fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>(
+ "address",
+ |m: &StellarContractIDPreimageFromAddress| { &m.address },
+ |m: &mut StellarContractIDPreimageFromAddress| { &mut m.address },
+ ));
+ fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>(
+ "salt",
+ |m: &StellarContractIDPreimageFromAddress| { &m.salt },
+ |m: &mut StellarContractIDPreimageFromAddress| { &mut m.salt },
+ ));
+ ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::<StellarContractIDPreimageFromAddress>(
+ "StellarContractIDPreimage.StellarContractIDPreimageFromAddress",
+ fields,
+ oneofs,
+ )
+ }
+ }
+
+ impl ::protobuf::Message for StellarContractIDPreimageFromAddress {
+ const NAME: &'static str = "StellarContractIDPreimageFromAddress";
+
+ fn is_initialized(&self) -> bool {
+ if self.address.is_none() {
+ return false;
+ }
+ if self.salt.is_none() {
+ return false;
+ }
+ true
+ }
+
+ fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::Result<()> {
+ while let Some(tag) = is.read_raw_tag_or_eof()? {
+ match tag {
+ 10 => {
+ self.address = ::std::option::Option::Some(is.read_string()?);
+ },
+ 18 => {
+ self.salt = ::std::option::Option::Some(is.read_bytes()?);
+ },
+ tag => {
+ ::protobuf::rt::read_unknown_or_skip_group(tag, is, self.special_fields.mut_unknown_fields())?;
+ },
+ };
+ }
+ ::std::result::Result::Ok(())
+ }
+
+ // Compute sizes of nested messages
+ #[allow(unused_variables)]
+ fn compute_size(&self) -> u64 {
+ let mut my_size = 0;
+ if let Some(v) = self.address.as_ref() {
+ my_size += ::protobuf::rt::string_size(1, &v);
+ }
+ if let Some(v) = self.salt.as_ref() {
+ my_size += ::protobuf::rt::bytes_size(2, &v);
+ }
+ my_size += ::protobuf::rt::unknown_fields_size(self.special_fields.unknown_fields());
+ self.special_fields.cached_size().set(my_size as u32);
+ my_size
+ }
+
+ fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::Result<()> {
+ if let Some(v) = self.address.as_ref() {
+ os.write_string(1, v)?;
+ }
+ if let Some(v) = self.salt.as_ref() {
+ os.write_bytes(2, v)?;
+ }
+ os.write_unknown_fields(self.special_fields.unknown_fields())?;
+ ::std::result::Result::Ok(())
+ }
+
+ fn special_fields(&self) -> &::protobuf::SpecialFields {
+ &self.special_fields
+ }
+
+ fn mut_special_fields(&mut self) -> &mut ::protobuf::SpecialFields {
+ &mut self.special_fields
+ }
+
+ fn new() -> StellarContractIDPreimageFromAddress {
+ StellarContractIDPreimageFromAddress::new()
+ }
+
+ fn clear(&mut self) {
+ self.address = ::std::option::Option::None;
+ self.salt = ::std::option::Option::None;
+ self.special_fields.clear();
+ }
+
+ fn default_instance() -> &'static StellarContractIDPreimageFromAddress {
+ static instance: StellarContractIDPreimageFromAddress = StellarContractIDPreimageFromAddress {
+ address: ::std::option::Option::None,
+ salt: ::std::option::Option::None,
+ special_fields: ::protobuf::SpecialFields::new(),
+ };
+ &instance
+ }
+ }
+
+ impl ::protobuf::MessageFull for StellarContractIDPreimageFromAddress {
+ fn descriptor() -> ::protobuf::reflect::MessageDescriptor {
+ static descriptor: ::protobuf::rt::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::Lazy::new();
+ descriptor.get(|| super::file_descriptor().message_by_package_relative_name("StellarContractIDPreimage.StellarContractIDPreimageFromAddress").unwrap()).clone()
+ }
+ }
+
+ impl ::std::fmt::Display for StellarContractIDPreimageFromAddress {
+ fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
+ ::protobuf::text_format::fmt(self, f)
+ }
+ }
+
+ impl ::protobuf::reflect::ProtobufValue for StellarContractIDPreimageFromAddress {
+ type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage<Self>;
+ }
+
+ #[derive(Clone,Copy,PartialEq,Eq,Debug,Hash)]
+ // @@protoc_insertion_point(enum:hw.trezor.messages.stellar.StellarContractIDPreimage.StellarContractIDPreimageType)
+ pub enum StellarContractIDPreimageType {
+ // @@protoc_insertion_point(enum_value:hw.trezor.messages.stellar.StellarContractIDPreimage.StellarContractIDPreimageType.CONTRACT_ID_PREIMAGE_FROM_ADDRESS)
+ CONTRACT_ID_PREIMAGE_FROM_ADDRESS = 0,
+ }
+
+ impl ::protobuf::Enum for StellarContractIDPreimageType {
+ const NAME: &'static str = "StellarContractIDPreimageType";
+
+ fn value(&self) -> i32 {
+ *self as i32
+ }
+
+ fn from_i32(value: i32) -> ::std::option::Option<StellarContractIDPreimageType> {
+ match value {
+ 0 => ::std::option::Option::Some(StellarContractIDPreimageType::CONTRACT_ID_PREIMAGE_FROM_ADDRESS),
+ _ => ::std::option::Option::None
+ }
+ }
+
+ fn from_str(str: &str) -> ::std::option::Option<StellarContractIDPreimageType> {
+ match str {
+ "CONTRACT_ID_PREIMAGE_FROM_ADDRESS" => ::std::option::Option::Some(StellarContractIDPreimageType::CONTRACT_ID_PREIMAGE_FROM_ADDRESS),
+ _ => ::std::option::Option::None
+ }
+ }
+
+ const VALUES: &'static [StellarContractIDPreimageType] = &[
+ StellarContractIDPreimageType::CONTRACT_ID_PREIMAGE_FROM_ADDRESS,
+ ];
+ }
+
+ impl ::protobuf::EnumFull for StellarContractIDPreimageType {
+ fn enum_descriptor() -> ::protobuf::reflect::EnumDescriptor {
+ static descriptor: ::protobuf::rt::Lazy<::protobuf::reflect::EnumDescriptor> = ::protobuf::rt::Lazy::new();
+ descriptor.get(|| super::file_descriptor().enum_by_package_relative_name("StellarContractIDPreimage.StellarContractIDPreimageType").unwrap()).clone()
+ }
+
+ fn descriptor(&self) -> ::protobuf::reflect::EnumValueDescriptor {
+ let index = *self as usize;
+ Self::enum_descriptor().value_by_index(index)
+ }
+ }
+
+ impl ::std::default::Default for StellarContractIDPreimageType {
+ fn default() -> Self {
+ StellarContractIDPreimageType::CONTRACT_ID_PREIMAGE_FROM_ADDRESS
+ }
+ }
+
+ impl StellarContractIDPreimageType {
+ pub(in super) fn generated_enum_descriptor_data() -> ::protobuf::reflect::GeneratedEnumDescriptorData {
+ ::protobuf::reflect::GeneratedEnumDescriptorData::new::<StellarContractIDPreimageType>("StellarContractIDPreimage.StellarContractIDPreimageType")
+ }
+ }
+}
+
+// @@protoc_insertion_point(message:hw.trezor.messages.stellar.StellarContractExecutable)
+#[derive(PartialEq,Clone,Default,Debug)]
+pub struct StellarContractExecutable {
+ // message fields
+ // @@protoc_insertion_point(field:hw.trezor.messages.stellar.StellarContractExecutable.type)
+ pub type_: ::std::option::Option<::protobuf::EnumOrUnknown<stellar_contract_executable::StellarContractExecutableType>>,
+ // @@protoc_insertion_point(field:hw.trezor.messages.stellar.StellarContractExecutable.wasm_hash)
+ pub wasm_hash: ::std::option::Option<::std::vec::Vec<u8>>,
+ // special fields
+ // @@protoc_insertion_point(special_field:hw.trezor.messages.stellar.StellarContractExecutable.special_fields)
+ pub special_fields: ::protobuf::SpecialFields,
+}
+
+impl<'a> ::std::default::Default for &'a StellarContractExecutable {
+ fn default() -> &'a StellarContractExecutable {
+ <StellarContractExecutable as ::protobuf::Message>::default_instance()
+ }
+}
+
+impl StellarContractExecutable {
+ pub fn new() -> StellarContractExecutable {
+ ::std::default::Default::default()
+ }
+
+ // required .hw.trezor.messages.stellar.StellarContractExecutable.StellarContractExecutableType type = 1;
+
+ pub fn type_(&self) -> stellar_contract_executable::StellarContractExecutableType {
+ match self.type_ {
+ Some(e) => e.enum_value_or(stellar_contract_executable::StellarContractExecutableType::CONTRACT_EXECUTABLE_WASM),
+ None => stellar_contract_executable::StellarContractExecutableType::CONTRACT_EXECUTABLE_WASM,
+ }
+ }
+
+ pub fn clear_type_(&mut self) {
+ self.type_ = ::std::option::Option::None;
+ }
+
+ pub fn has_type(&self) -> bool {
+ self.type_.is_some()
+ }
+
+ // Param is passed by value, moved
+ pub fn set_type(&mut self, v: stellar_contract_executable::StellarContractExecutableType) {
+ self.type_ = ::std::option::Option::Some(::protobuf::EnumOrUnknown::new(v));
+ }
+
+ // optional bytes wasm_hash = 2;
+
+ pub fn wasm_hash(&self) -> &[u8] {
+ match self.wasm_hash.as_ref() {
+ Some(v) => v,
+ None => &[],
+ }
+ }
+
+ pub fn clear_wasm_hash(&mut self) {
+ self.wasm_hash = ::std::option::Option::None;
+ }
+
+ pub fn has_wasm_hash(&self) -> bool {
+ self.wasm_hash.is_some()
+ }
+
+ // Param is passed by value, moved
+ pub fn set_wasm_hash(&mut self, v: ::std::vec::Vec<u8>) {
+ self.wasm_hash = ::std::option::Option::Some(v);
+ }
+
+ // Mutable pointer to the field.
+ // If field is not initialized, it is initialized with default value first.
+ pub fn mut_wasm_hash(&mut self) -> &mut ::std::vec::Vec<u8> {
+ if self.wasm_hash.is_none() {
+ self.wasm_hash = ::std::option::Option::Some(::std::vec::Vec::new());
+ }
+ self.wasm_hash.as_mut().unwrap()
+ }
+
+ // Take field
+ pub fn take_wasm_hash(&mut self) -> ::std::vec::Vec<u8> {
+ self.wasm_hash.take().unwrap_or_else(|| ::std::vec::Vec::new())
+ }
+
+ fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData {
+ let mut fields = ::std::vec::Vec::with_capacity(2);
+ let mut oneofs = ::std::vec::Vec::with_capacity(0);
+ fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>(
+ "type",
+ |m: &StellarContractExecutable| { &m.type_ },
+ |m: &mut StellarContractExecutable| { &mut m.type_ },
+ ));
+ fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>(
+ "wasm_hash",
+ |m: &StellarContractExecutable| { &m.wasm_hash },
+ |m: &mut StellarContractExecutable| { &mut m.wasm_hash },
+ ));
+ ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::<StellarContractExecutable>(
+ "StellarContractExecutable",
+ fields,
+ oneofs,
+ )
+ }
+}
+
+impl ::protobuf::Message for StellarContractExecutable {
+ const NAME: &'static str = "StellarContractExecutable";
+
+ fn is_initialized(&self) -> bool {
+ if self.type_.is_none() {
+ return false;
+ }
+ true
+ }
+
+ fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::Result<()> {
+ while let Some(tag) = is.read_raw_tag_or_eof()? {
+ match tag {
+ 8 => {
+ self.type_ = ::std::option::Option::Some(is.read_enum_or_unknown()?);
+ },
+ 18 => {
+ self.wasm_hash = ::std::option::Option::Some(is.read_bytes()?);
+ },
+ tag => {
+ ::protobuf::rt::read_unknown_or_skip_group(tag, is, self.special_fields.mut_unknown_fields())?;
+ },
+ };
+ }
+ ::std::result::Result::Ok(())
+ }
+
+ // Compute sizes of nested messages
+ #[allow(unused_variables)]
+ fn compute_size(&self) -> u64 {
+ let mut my_size = 0;
+ if let Some(v) = self.type_ {
+ my_size += ::protobuf::rt::int32_size(1, v.value());
+ }
+ if let Some(v) = self.wasm_hash.as_ref() {
+ my_size += ::protobuf::rt::bytes_size(2, &v);
+ }
+ my_size += ::protobuf::rt::unknown_fields_size(self.special_fields.unknown_fields());
+ self.special_fields.cached_size().set(my_size as u32);
+ my_size
+ }
+
+ fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::Result<()> {
+ if let Some(v) = self.type_ {
+ os.write_enum(1, ::protobuf::EnumOrUnknown::value(&v))?;
+ }
+ if let Some(v) = self.wasm_hash.as_ref() {
+ os.write_bytes(2, v)?;
+ }
+ os.write_unknown_fields(self.special_fields.unknown_fields())?;
+ ::std::result::Result::Ok(())
+ }
+
+ fn special_fields(&self) -> &::protobuf::SpecialFields {
+ &self.special_fields
+ }
+
+ fn mut_special_fields(&mut self) -> &mut ::protobuf::SpecialFields {
+ &mut self.special_fields
+ }
+
+ fn new() -> StellarContractExecutable {
+ StellarContractExecutable::new()
+ }
+
+ fn clear(&mut self) {
+ self.type_ = ::std::option::Option::None;
+ self.wasm_hash = ::std::option::Option::None;
+ self.special_fields.clear();
+ }
+
+ fn default_instance() -> &'static StellarContractExecutable {
+ static instance: StellarContractExecutable = StellarContractExecutable {
+ type_: ::std::option::Option::None,
+ wasm_hash: ::std::option::Option::None,
+ special_fields: ::protobuf::SpecialFields::new(),
+ };
+ &instance
+ }
+}
+
+impl ::protobuf::MessageFull for StellarContractExecutable {
+ fn descriptor() -> ::protobuf::reflect::MessageDescriptor {
+ static descriptor: ::protobuf::rt::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::Lazy::new();
+ descriptor.get(|| file_descriptor().message_by_package_relative_name("StellarContractExecutable").unwrap()).clone()
+ }
+}
+
+impl ::std::fmt::Display for StellarContractExecutable {
+ fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
+ ::protobuf::text_format::fmt(self, f)
+ }
+}
+
+impl ::protobuf::reflect::ProtobufValue for StellarContractExecutable {
+ type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage<Self>;
+}
+
+/// Nested message and enums of message `StellarContractExecutable`
+pub mod stellar_contract_executable {
+ #[derive(Clone,Copy,PartialEq,Eq,Debug,Hash)]
+ // @@protoc_insertion_point(enum:hw.trezor.messages.stellar.StellarContractExecutable.StellarContractExecutableType)
+ pub enum StellarContractExecutableType {
+ // @@protoc_insertion_point(enum_value:hw.trezor.messages.stellar.StellarContractExecutable.StellarContractExecutableType.CONTRACT_EXECUTABLE_WASM)
+ CONTRACT_EXECUTABLE_WASM = 0,
+ }
+
+ impl ::protobuf::Enum for StellarContractExecutableType {
+ const NAME: &'static str = "StellarContractExecutableType";
+
+ fn value(&self) -> i32 {
+ *self as i32
+ }
+
+ fn from_i32(value: i32) -> ::std::option::Option<StellarContractExecutableType> {
+ match value {
+ 0 => ::std::option::Option::Some(StellarContractExecutableType::CONTRACT_EXECUTABLE_WASM),
+ _ => ::std::option::Option::None
+ }
+ }
+
+ fn from_str(str: &str) -> ::std::option::Option<StellarContractExecutableType> {
+ match str {
+ "CONTRACT_EXECUTABLE_WASM" => ::std::option::Option::Some(StellarContractExecutableType::CONTRACT_EXECUTABLE_WASM),
+ _ => ::std::option::Option::None
+ }
+ }
+
+ const VALUES: &'static [StellarContractExecutableType] = &[
+ StellarContractExecutableType::CONTRACT_EXECUTABLE_WASM,
+ ];
+ }
+
+ impl ::protobuf::EnumFull for StellarContractExecutableType {
+ fn enum_descriptor() -> ::protobuf::reflect::EnumDescriptor {
+ static descriptor: ::protobuf::rt::Lazy<::protobuf::reflect::EnumDescriptor> = ::protobuf::rt::Lazy::new();
+ descriptor.get(|| super::file_descriptor().enum_by_package_relative_name("StellarContractExecutable.StellarContractExecutableType").unwrap()).clone()
+ }
+
+ fn descriptor(&self) -> ::protobuf::reflect::EnumValueDescriptor {
+ let index = *self as usize;
+ Self::enum_descriptor().value_by_index(index)
+ }
+ }
+
+ impl ::std::default::Default for StellarContractExecutableType {
+ fn default() -> Self {
+ StellarContractExecutableType::CONTRACT_EXECUTABLE_WASM
+ }
+ }
+
+ impl StellarContractExecutableType {
+ pub(in super) fn generated_enum_descriptor_data() -> ::protobuf::reflect::GeneratedEnumDescriptorData {
+ ::protobuf::reflect::GeneratedEnumDescriptorData::new::<StellarContractExecutableType>("StellarContractExecutable.StellarContractExecutableType")
+ }
+ }
+}
+
+// @@protoc_insertion_point(message:hw.trezor.messages.stellar.StellarCreateContractArgsV2)
+#[derive(PartialEq,Clone,Default,Debug)]
+pub struct StellarCreateContractArgsV2 {
+ // message fields
+ // @@protoc_insertion_point(field:hw.trezor.messages.stellar.StellarCreateContractArgsV2.contract_id_preimage)
+ pub contract_id_preimage: ::protobuf::MessageField<StellarContractIDPreimage>,
+ // @@protoc_insertion_point(field:hw.trezor.messages.stellar.StellarCreateContractArgsV2.executable)
+ pub executable: ::protobuf::MessageField<StellarContractExecutable>,
+ // @@protoc_insertion_point(field:hw.trezor.messages.stellar.StellarCreateContractArgsV2.constructor_args)
+ pub constructor_args: ::std::vec::Vec<StellarSCVal>,
+ // special fields
+ // @@protoc_insertion_point(special_field:hw.trezor.messages.stellar.StellarCreateContractArgsV2.special_fields)
+ pub special_fields: ::protobuf::SpecialFields,
+}
+
+impl<'a> ::std::default::Default for &'a StellarCreateContractArgsV2 {
+ fn default() -> &'a StellarCreateContractArgsV2 {
+ <StellarCreateContractArgsV2 as ::protobuf::Message>::default_instance()
+ }
+}
+
+impl StellarCreateContractArgsV2 {
+ pub fn new() -> StellarCreateContractArgsV2 {
+ ::std::default::Default::default()
+ }
+
+ fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData {
+ let mut fields = ::std::vec::Vec::with_capacity(3);
+ let mut oneofs = ::std::vec::Vec::with_capacity(0);
+ fields.push(::protobuf::reflect::rt::v2::make_message_field_accessor::<_, StellarContractIDPreimage>(
+ "contract_id_preimage",
+ |m: &StellarCreateContractArgsV2| { &m.contract_id_preimage },
+ |m: &mut StellarCreateContractArgsV2| { &mut m.contract_id_preimage },
+ ));
+ fields.push(::protobuf::reflect::rt::v2::make_message_field_accessor::<_, StellarContractExecutable>(
+ "executable",
+ |m: &StellarCreateContractArgsV2| { &m.executable },
+ |m: &mut StellarCreateContractArgsV2| { &mut m.executable },
+ ));
+ fields.push(::protobuf::reflect::rt::v2::make_vec_simpler_accessor::<_, _>(
+ "constructor_args",
+ |m: &StellarCreateContractArgsV2| { &m.constructor_args },
+ |m: &mut StellarCreateContractArgsV2| { &mut m.constructor_args },
+ ));
+ ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::<StellarCreateContractArgsV2>(
+ "StellarCreateContractArgsV2",
+ fields,
+ oneofs,
+ )
+ }
+}
+
+impl ::protobuf::Message for StellarCreateContractArgsV2 {
+ const NAME: &'static str = "StellarCreateContractArgsV2";
+
+ fn is_initialized(&self) -> bool {
+ if self.contract_id_preimage.is_none() {
+ return false;
+ }
+ if self.executable.is_none() {
+ return false;
+ }
+ for v in &self.contract_id_preimage {
+ if !v.is_initialized() {
+ return false;
+ }
+ };
+ for v in &self.executable {
+ if !v.is_initialized() {
+ return false;
+ }
+ };
+ for v in &self.constructor_args {
+ if !v.is_initialized() {
+ return false;
+ }
+ };
+ true
+ }
+
+ fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::Result<()> {
+ while let Some(tag) = is.read_raw_tag_or_eof()? {
+ match tag {
+ 10 => {
+ ::protobuf::rt::read_singular_message_into_field(is, &mut self.contract_id_preimage)?;
+ },
+ 18 => {
+ ::protobuf::rt::read_singular_message_into_field(is, &mut self.executable)?;
+ },
+ 26 => {
+ self.constructor_args.push(is.read_message()?);
+ },
+ tag => {
+ ::protobuf::rt::read_unknown_or_skip_group(tag, is, self.special_fields.mut_unknown_fields())?;
+ },
+ };
+ }
+ ::std::result::Result::Ok(())
+ }
+
+ // Compute sizes of nested messages
+ #[allow(unused_variables)]
+ fn compute_size(&self) -> u64 {
+ let mut my_size = 0;
+ if let Some(v) = self.contract_id_preimage.as_ref() {
+ let len = v.compute_size();
+ my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len;
+ }
+ if let Some(v) = self.executable.as_ref() {
+ let len = v.compute_size();
+ my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len;
+ }
+ for value in &self.constructor_args {
+ let len = value.compute_size();
+ my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len;
+ };
+ my_size += ::protobuf::rt::unknown_fields_size(self.special_fields.unknown_fields());
+ self.special_fields.cached_size().set(my_size as u32);
+ my_size
+ }
+
+ fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::Result<()> {
+ if let Some(v) = self.contract_id_preimage.as_ref() {
+ ::protobuf::rt::write_message_field_with_cached_size(1, v, os)?;
+ }
+ if let Some(v) = self.executable.as_ref() {
+ ::protobuf::rt::write_message_field_with_cached_size(2, v, os)?;
+ }
+ for v in &self.constructor_args {
+ ::protobuf::rt::write_message_field_with_cached_size(3, v, os)?;
+ };
+ os.write_unknown_fields(self.special_fields.unknown_fields())?;
+ ::std::result::Result::Ok(())
+ }
+
+ fn special_fields(&self) -> &::protobuf::SpecialFields {
+ &self.special_fields
+ }
+
+ fn mut_special_fields(&mut self) -> &mut ::protobuf::SpecialFields {
+ &mut self.special_fields
+ }
+
+ fn new() -> StellarCreateContractArgsV2 {
+ StellarCreateContractArgsV2::new()
+ }
+
+ fn clear(&mut self) {
+ self.contract_id_preimage.clear();
+ self.executable.clear();
+ self.constructor_args.clear();
+ self.special_fields.clear();
+ }
+
+ fn default_instance() -> &'static StellarCreateContractArgsV2 {
+ static instance: StellarCreateContractArgsV2 = StellarCreateContractArgsV2 {
+ contract_id_preimage: ::protobuf::MessageField::none(),
+ executable: ::protobuf::MessageField::none(),
+ constructor_args: ::std::vec::Vec::new(),
+ special_fields: ::protobuf::SpecialFields::new(),
+ };
+ &instance
+ }
+}
+
+impl ::protobuf::MessageFull for StellarCreateContractArgsV2 {
+ fn descriptor() -> ::protobuf::reflect::MessageDescriptor {
+ static descriptor: ::protobuf::rt::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::Lazy::new();
+ descriptor.get(|| file_descriptor().message_by_package_relative_name("StellarCreateContractArgsV2").unwrap()).clone()
+ }
+}
+
+impl ::std::fmt::Display for StellarCreateContractArgsV2 {
+ fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
+ ::protobuf::text_format::fmt(self, f)
+ }
+}
+
+impl ::protobuf::reflect::ProtobufValue for StellarCreateContractArgsV2 {
+ type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage<Self>;
+}
+
// @@protoc_insertion_point(message:hw.trezor.messages.stellar.StellarSorobanAuthorizedFunction)
#[derive(PartialEq,Clone,Default,Debug)]
pub struct StellarSorobanAuthorizedFunction {
@@ -8525,6 +9417,8 @@ pub struct StellarSorobanAuthorizedFunction {
pub type_: ::std::option::Option<::protobuf::EnumOrUnknown<stellar_soroban_authorized_function::StellarSorobanAuthorizedFunctionType>>,
// @@protoc_insertion_point(field:hw.trezor.messages.stellar.StellarSorobanAuthorizedFunction.contract_fn)
pub contract_fn: ::protobuf::MessageField<StellarInvokeContractArgs>,
+ // @@protoc_insertion_point(field:hw.trezor.messages.stellar.StellarSorobanAuthorizedFunction.create_contract_v2_host_fn)
+ pub create_contract_v2_host_fn: ::protobuf::MessageField<StellarCreateContractArgsV2>,
// special fields
// @@protoc_insertion_point(special_field:hw.trezor.messages.stellar.StellarSorobanAuthorizedFunction.special_fields)
pub special_fields: ::protobuf::SpecialFields,
@@ -8564,7 +9458,7 @@ impl StellarSorobanAuthorizedFunction {
}
fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData {
- let mut fields = ::std::vec::Vec::with_capacity(2);
+ let mut fields = ::std::vec::Vec::with_capacity(3);
let mut oneofs = ::std::vec::Vec::with_capacity(0);
fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>(
"type",
@@ -8576,6 +9470,11 @@ impl StellarSorobanAuthorizedFunction {
|m: &StellarSorobanAuthorizedFunction| { &m.contract_fn },
|m: &mut StellarSorobanAuthorizedFunction| { &mut m.contract_fn },
));
+ fields.push(::protobuf::reflect::rt::v2::make_message_field_accessor::<_, StellarCreateContractArgsV2>(
+ "create_contract_v2_host_fn",
+ |m: &StellarSorobanAuthorizedFunction| { &m.create_contract_v2_host_fn },
+ |m: &mut StellarSorobanAuthorizedFunction| { &mut m.create_contract_v2_host_fn },
+ ));
::protobuf::reflect::GeneratedMessageDescriptorData::new_2::<StellarSorobanAuthorizedFunction>(
"StellarSorobanAuthorizedFunction",
fields,
@@ -8596,6 +9495,11 @@ impl ::protobuf::Message for StellarSorobanAuthorizedFunction {
return false;
}
};
+ for v in &self.create_contract_v2_host_fn {
+ if !v.is_initialized() {
+ return false;
+ }
+ };
true
}
@@ -8608,6 +9512,9 @@ impl ::protobuf::Message for StellarSorobanAuthorizedFunction {
18 => {
::protobuf::rt::read_singular_message_into_field(is, &mut self.contract_fn)?;
},
+ 26 => {
+ ::protobuf::rt::read_singular_message_into_field(is, &mut self.create_contract_v2_host_fn)?;
+ },
tag => {
::protobuf::rt::read_unknown_or_skip_group(tag, is, self.special_fields.mut_unknown_fields())?;
},
@@ -8627,6 +9534,10 @@ impl ::protobuf::Message for StellarSorobanAuthorizedFunction {
let len = v.compute_size();
my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len;
}
+ if let Some(v) = self.create_contract_v2_host_fn.as_ref() {
+ let len = v.compute_size();
+ my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len;
+ }
my_size += ::protobuf::rt::unknown_fields_size(self.special_fields.unknown_fields());
self.special_fields.cached_size().set(my_size as u32);
my_size
@@ -8639,6 +9550,9 @@ impl ::protobuf::Message for StellarSorobanAuthorizedFunction {
if let Some(v) = self.contract_fn.as_ref() {
::protobuf::rt::write_message_field_with_cached_size(2, v, os)?;
}
+ if let Some(v) = self.create_contract_v2_host_fn.as_ref() {
+ ::protobuf::rt::write_message_field_with_cached_size(3, v, os)?;
+ }
os.write_unknown_fields(self.special_fields.unknown_fields())?;
::std::result::Result::Ok(())
}
@@ -8658,13 +9572,15 @@ impl ::protobuf::Message for StellarSorobanAuthorizedFunction {
fn clear(&mut self) {
self.type_ = ::std::option::Option::None;
self.contract_fn.clear();
+ self.create_contract_v2_host_fn.clear();
self.special_fields.clear();
}
fn default_instance() -> &'static StellarSorobanAuthorizedFunction {
static instance: StellarSorobanAuthorizedFunction = StellarSorobanAuthorizedFunction {
type_: ::std::option::Option::None,
contract_fn: ::protobuf::MessageField::none(),
+ create_contract_v2_host_fn: ::protobuf::MessageField::none(),
special_fields: ::protobuf::SpecialFields::new(),
};
&instance
@@ -8695,6 +9611,8 @@ pub mod stellar_soroban_authorized_function {
pub enum StellarSorobanAuthorizedFunctionType {
// @@protoc_insertion_point(enum_value:hw.trezor.messages.stellar.StellarSorobanAuthorizedFunction.StellarSorobanAuthorizedFunctionType.SOROBAN_AUTHORIZED_FUNCTION_TYPE_CONTRACT_FN)
SOROBAN_AUTHORIZED_FUNCTION_TYPE_CONTRACT_FN = 0,
+ // @@protoc_insertion_point(enum_value:hw.trezor.messages.stellar.StellarSorobanAuthorizedFunction.StellarSorobanAuthorizedFunctionType.SOROBAN_AUTHORIZED_FUNCTION_TYPE_CREATE_CONTRACT_V2_HOST_FN)
+ SOROBAN_AUTHORIZED_FUNCTION_TYPE_CREATE_CONTRACT_V2_HOST_FN = 2,
}
impl ::protobuf::Enum for StellarSorobanAuthorizedFunctionType {
@@ -8707,19 +9625,22 @@ pub mod stellar_soroban_authorized_function {
fn from_i32(value: i32) -> ::std::option::Option<StellarSorobanAuthorizedFunctionType> {
match value {
0 => ::std::option::Option::Some(StellarSorobanAuthorizedFunctionType::SOROBAN_AUTHORIZED_FUNCTION_TYPE_CONTRACT_FN),
+ 2 => ::std::option::Option::Some(StellarSorobanAuthorizedFunctionType::SOROBAN_AUTHORIZED_FUNCTION_TYPE_CREATE_CONTRACT_V2_HOST_FN),
_ => ::std::option::Option::None
}
}
fn from_str(str: &str) -> ::std::option::Option<StellarSorobanAuthorizedFunctionType> {
match str {
"SOROBAN_AUTHORIZED_FUNCTION_TYPE_CONTRACT_FN" => ::std::option::Option::Some(StellarSorobanAuthorizedFunctionType::SOROBAN_AUTHORIZED_FUNCTION_TYPE_CONTRACT_FN),
+ "SOROBAN_AUTHORIZED_FUNCTION_TYPE_CREATE_CONTRACT_V2_HOST_FN" => ::std::option::Option::Some(StellarSorobanAuthorizedFunctionType::SOROBAN_AUTHORIZED_FUNCTION_TYPE_CREATE_CONTRACT_V2_HOST_FN),
_ => ::std::option::Option::None
}
}
const VALUES: &'static [StellarSorobanAuthorizedFunctionType] = &[
StellarSorobanAuthorizedFunctionType::SOROBAN_AUTHORIZED_FUNCTION_TYPE_CONTRACT_FN,
+ StellarSorobanAuthorizedFunctionType::SOROBAN_AUTHORIZED_FUNCTION_TYPE_CREATE_CONTRACT_V2_HOST_FN,
];
}
@@ -8730,7 +9651,10 @@ pub mod stellar_soroban_authorized_function {
}
fn descriptor(&self) -> ::protobuf::reflect::EnumValueDescriptor {
- let index = *self as usize;
+ let index = match self {
+ StellarSorobanAuthorizedFunctionType::SOROBAN_AUTHORIZED_FUNCTION_TYPE_CONTRACT_FN => 0,
+ StellarSorobanAuthorizedFunctionType::SOROBAN_AUTHORIZED_FUNCTION_TYPE_CREATE_CONTRACT_V2_HOST_FN => 1,
+ };
Self::enum_descriptor().value_by_index(index)
}
}
@@ -8911,6 +9835,8 @@ pub struct StellarHostFunction {
pub type_: ::std::option::Option<::protobuf::EnumOrUnknown<stellar_host_function::StellarHostFunctionType>>,
// @@protoc_insertion_point(field:hw.trezor.messages.stellar.StellarHostFunction.invoke_contract)
pub invoke_contract: ::protobuf::MessageField<StellarInvokeContractArgs>,
+ // @@protoc_insertion_point(field:hw.trezor.messages.stellar.StellarHostFunction.create_contract_v2)
+ pub create_contract_v2: ::protobuf::MessageField<StellarCreateContractArgsV2>,
// special fields
// @@protoc_insertion_point(special_field:hw.trezor.messages.stellar.StellarHostFunction.special_fields)
pub special_fields: ::protobuf::SpecialFields,
@@ -8950,7 +9876,7 @@ impl StellarHostFunction {
}
fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData {
- let mut fields = ::std::vec::Vec::with_capacity(2);
+ let mut fields = ::std::vec::Vec::with_capacity(3);
let mut oneofs = ::std::vec::Vec::with_capacity(0);
fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>(
"type",
@@ -8962,6 +9888,11 @@ impl StellarHostFunction {
|m: &StellarHostFunction| { &m.invoke_contract },
|m: &mut StellarHostFunction| { &mut m.invoke_contract },
));
+ fields.push(::protobuf::reflect::rt::v2::make_message_field_accessor::<_, StellarCreateContractArgsV2>(
+ "create_contract_v2",
+ |m: &StellarHostFunction| { &m.create_contract_v2 },
+ |m: &mut StellarHostFunction| { &mut m.create_contract_v2 },
+ ));
::protobuf::reflect::GeneratedMessageDescriptorData::new_2::<StellarHostFunction>(
"StellarHostFunction",
fields,
@@ -8982,6 +9913,11 @@ impl ::protobuf::Message for StellarHostFunction {
return false;
}
};
+ for v in &self.create_contract_v2 {
+ if !v.is_initialized() {
+ return false;
+ }
+ };
true
}
@@ -8994,6 +9930,9 @@ impl ::protobuf::Message for StellarHostFunction {
18 => {
::protobuf::rt::read_singular_message_into_field(is, &mut self.invoke_contract)?;
},
+ 26 => {
+ ::protobuf::rt::read_singular_message_into_field(is, &mut self.create_contract_v2)?;
+ },
tag => {
::protobuf::rt::read_unknown_or_skip_group(tag, is, self.special_fields.mut_unknown_fields())?;
},
@@ -9013,6 +9952,10 @@ impl ::protobuf::Message for StellarHostFunction {
let len = v.compute_size();
my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len;
}
+ if let Some(v) = self.create_contract_v2.as_ref() {
+ let len = v.compute_size();
+ my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len;
+ }
my_size += ::protobuf::rt::unknown_fields_size(self.special_fields.unknown_fields());
self.special_fields.cached_size().set(my_size as u32);
my_size
@@ -9025,6 +9968,9 @@ impl ::protobuf::Message for StellarHostFunction {
if let Some(v) = self.invoke_contract.as_ref() {
::protobuf::rt::write_message_field_with_cached_size(2, v, os)?;
}
+ if let Some(v) = self.create_contract_v2.as_ref() {
+ ::protobuf::rt::write_message_field_with_cached_size(3, v, os)?;
+ }
os.write_unknown_fields(self.special_fields.unknown_fields())?;
::std::result::Result::Ok(())
}
@@ -9044,13 +9990,15 @@ impl ::protobuf::Message for StellarHostFunction {
fn clear(&mut self) {
self.type_ = ::std::option::Option::None;
self.invoke_contract.clear();
+ self.create_contract_v2.clear();
self.special_fields.clear();
}
fn default_instance() -> &'static StellarHostFunction {
static instance: StellarHostFunction = StellarHostFunction {
type_: ::std::option::Option::None,
invoke_contract: ::protobuf::MessageField::none(),
+ create_contract_v2: ::protobuf::MessageField::none(),
special_fields: ::protobuf::SpecialFields::new(),
};
&instance
@@ -9081,6 +10029,8 @@ pub mod stellar_host_function {
pub enum StellarHostFunctionType {
// @@protoc_insertion_point(enum_value:hw.trezor.messages.stellar.StellarHostFunction.StellarHostFunctionType.HOST_FUNCTION_TYPE_INVOKE_CONTRACT)
HOST_FUNCTION_TYPE_INVOKE_CONTRACT = 0,
+ // @@protoc_insertion_point(enum_value:hw.trezor.messages.stellar.StellarHostFunction.StellarHostFunctionType.HOST_FUNCTION_TYPE_CREATE_CONTRACT_V2)
+ HOST_FUNCTION_TYPE_CREATE_CONTRACT_V2 = 3,
}
impl ::protobuf::Enum for StellarHostFunctionType {
@@ -9093,19 +10043,22 @@ pub mod stellar_host_function {
fn from_i32(value: i32) -> ::std::option::Option<StellarHostFunctionType> {
match value {
0 => ::std::option::Option::Some(StellarHostFunctionType::HOST_FUNCTION_TYPE_INVOKE_CONTRACT),
+ 3 => ::std::option::Option::Some(StellarHostFunctionType::HOST_FUNCTION_TYPE_CREATE_CONTRACT_V2),
_ => ::std::option::Option::None
}
}
fn from_str(str: &str) -> ::std::option::Option<StellarHostFunctionType> {
match str {
"HOST_FUNCTION_TYPE_INVOKE_CONTRACT" => ::std::option::Option::Some(StellarHostFunctionType::HOST_FUNCTION_TYPE_INVOKE_CONTRACT),
+ "HOST_FUNCTION_TYPE_CREATE_CONTRACT_V2" => ::std::option::Option::Some(StellarHostFunctionType::HOST_FUNCTION_TYPE_CREATE_CONTRACT_V2),
_ => ::std::option::Option::None
}
}
const VALUES: &'static [StellarHostFunctionType] = &[
StellarHostFunctionType::HOST_FUNCTION_TYPE_INVOKE_CONTRACT,
+ StellarHostFunctionType::HOST_FUNCTION_TYPE_CREATE_CONTRACT_V2,
];
}
@@ -9116,7 +10069,10 @@ pub mod stellar_host_function {
}
fn descriptor(&self) -> ::protobuf::reflect::EnumValueDescriptor {
- let index = *self as usize;
+ let index = match self {
+ StellarHostFunctionType::HOST_FUNCTION_TYPE_INVOKE_CONTRACT => 0,
+ StellarHostFunctionType::HOST_FUNCTION_TYPE_CREATE_CONTRACT_V2 => 1,
+ };
Self::enum_descriptor().value_by_index(index)
}
}
@@ -11718,75 +12674,98 @@ static file_descriptor_proto_data: &'static [u8] = b"\
\x02\x20\x02(\tR\x0cfunctionName\x12<\n\x04args\x18\x03\x20\x03(\x0b2(.h\
w.trezor.messages.stellar.StellarSCValR\x04args\x12G\n\nasset_hint\x18\
\x04\x20\x01(\x0b2(.hw.trezor.messages.stellar.StellarAssetR\tassetHint\
- \"\xd7\x02\n\x20StellarSorobanAuthorizedFunction\x12u\n\x04type\x18\x01\
- \x20\x02(\x0e2a.hw.trezor.messages.stellar.StellarSorobanAuthorizedFunct\
- ion.StellarSorobanAuthorizedFunctionTypeR\x04type\x12V\n\x0bcontract_fn\
- \x18\x02\x20\x01(\x0b25.hw.trezor.messages.stellar.StellarInvokeContract\
- ArgsR\ncontractFn\"d\n$StellarSorobanAuthorizedFunctionType\x120\n,SOROB\
- AN_AUTHORIZED_FUNCTION_TYPE_CONTRACT_FN\x10\0\"\x04\x08\x01\x10\x01\"\
- \x04\x08\x02\x10\x02\"\xe7\x01\n\"StellarSorobanAuthorizedInvocation\x12\
- X\n\x08function\x18\x01\x20\x02(\x0b2<.hw.trezor.messages.stellar.Stella\
- rSorobanAuthorizedFunctionR\x08function\x12g\n\x0fsub_invocations\x18\
- \x02\x20\x03(\x0b2>.hw.trezor.messages.stellar.StellarSorobanAuthorizedI\
- nvocationR\x0esubInvocations\"\xa7\x02\n\x13StellarHostFunction\x12[\n\
- \x04type\x18\x01\x20\x02(\x0e2G.hw.trezor.messages.stellar.StellarHostFu\
- nction.StellarHostFunctionTypeR\x04type\x12^\n\x0finvoke_contract\x18\
- \x02\x20\x01(\x0b25.hw.trezor.messages.stellar.StellarInvokeContractArgs\
- R\x0einvokeContract\"S\n\x17StellarHostFunctionType\x12&\n\"HOST_FUNCTIO\
- N_TYPE_INVOKE_CONTRACT\x10\0\"\x04\x08\x01\x10\x01\"\x04\x08\x02\x10\x02\
- \"\x04\x08\x03\x10\x03\"\xda\x01\n\x20StellarSorobanAddressCredentials\
- \x12\x18\n\x07address\x18\x01\x20\x02(\tR\x07address\x12\x14\n\x05nonce\
- \x18\x02\x20\x02(\x12R\x05nonce\x12>\n\x1bsignature_expiration_ledger\
- \x18\x03\x20\x02(\rR\x19signatureExpirationLedger\x12F\n\tsignature\x18\
- \x04\x20\x02(\x0b2(.hw.trezor.messages.stellar.StellarSCValR\tsignature\
- \"\xeb\x01\n\x1fStellarSorobanDelegateSignature\x12\x18\n\x07address\x18\
- \x01\x20\x02(\tR\x07address\x12F\n\tsignature\x18\x02\x20\x02(\x0b2(.hw.\
- trezor.messages.stellar.StellarSCValR\tsignature\x12f\n\x10nested_delega\
- tes\x18\x03\x20\x03(\x0b2;.hw.trezor.messages.stellar.StellarSorobanDele\
- gateSignatureR\x0fnestedDelegates\"\xf9\x01\n-StellarSorobanAddressCrede\
- ntialsWithDelegates\x12m\n\x13address_credentials\x18\x01\x20\x02(\x0b2<\
- .hw.trezor.messages.stellar.StellarSorobanAddressCredentialsR\x12address\
- Credentials\x12Y\n\tdelegates\x18\x02\x20\x03(\x0b2;.hw.trezor.messages.\
- stellar.StellarSorobanDelegateSignatureR\tdelegates\"\x86\x04\n\x19Stell\
- arSorobanCredentials\x12g\n\x04type\x18\x01\x20\x02(\x0e2S.hw.trezor.mes\
- sages.stellar.StellarSorobanCredentials.StellarSorobanCredentialsTypeR\
- \x04type\x12[\n\naddress_v2\x18\x02\x20\x01(\x0b2<.hw.trezor.messages.st\
- ellar.StellarSorobanAddressCredentialsR\taddressV2\x12\x7f\n\x16address_\
- with_delegates\x18\x03\x20\x01(\x0b2I.hw.trezor.messages.stellar.Stellar\
- SorobanAddressCredentialsWithDelegatesR\x14addressWithDelegates\"\xa1\
- \x01\n\x1dStellarSorobanCredentialsType\x12&\n\"SOROBAN_CREDENTIALS_SOUR\
- CE_ACCOUNT\x10\0\x12\"\n\x1eSOROBAN_CREDENTIALS_ADDRESS_V2\x10\x02\x12.\
- \n*SOROBAN_CREDENTIALS_ADDRESS_WITH_DELEGATES\x10\x03\"\x04\x08\x01\x10\
- \x01\"\xe4\x01\n\x20StellarSorobanAuthorizationEntry\x12W\n\x0bcredentia\
- ls\x18\x01\x20\x02(\x0b25.hw.trezor.messages.stellar.StellarSorobanCrede\
- ntialsR\x0bcredentials\x12g\n\x0froot_invocation\x18\x02\x20\x02(\x0b2>.\
- hw.trezor.messages.stellar.StellarSorobanAuthorizedInvocationR\x0erootIn\
- vocation\"\xe3\x01\n\x1bStellarInvokeHostFunctionOp\x12%\n\x0esource_acc\
- ount\x18\x01\x20\x01(\tR\rsourceAccount\x12K\n\x08function\x18\x02\x20\
- \x02(\x0b2/.hw.trezor.messages.stellar.StellarHostFunctionR\x08function\
- \x12P\n\x04auth\x18\x03\x20\x03(\x0b2<.hw.trezor.messages.stellar.Stella\
- rSorobanAuthorizationEntryR\x04auth\"\x86\x06\n\x1fStellarSignSorobanAut\
- horization\x12\x1b\n\taddress_n\x18\x01\x20\x03(\rR\x08addressN\x12-\n\
- \x12network_passphrase\x18\x02\x20\x02(\tR\x11networkPassphrase\x12\x88\
- \x01\n\renvelope_type\x18\x03\x20\x02(\x0e2c.hw.trezor.messages.stellar.\
- StellarSignSorobanAuthorization.StellarSorobanAuthorizationEnvelopeTypeR\
- \x0cenvelopeType\x12\xaf\x01\n\"soroban_authorization_with_address\x18\
- \x04\x20\x01(\x0b2b.hw.trezor.messages.stellar.StellarSignSorobanAuthori\
- zation.StellarSorobanAuthorizationWithAddressR\x1fsorobanAuthorizationWi\
- thAddress\x1a\xf8\x01\n&StellarSorobanAuthorizationWithAddress\x12\x14\n\
- \x05nonce\x18\x01\x20\x02(\x12R\x05nonce\x12>\n\x1bsignature_expiration_\
- ledger\x18\x02\x20\x02(\rR\x19signatureExpirationLedger\x12\x18\n\x07add\
- ress\x18\x03\x20\x02(\tR\x07address\x12^\n\ninvocation\x18\x04\x20\x02(\
- \x0b2>.hw.trezor.messages.stellar.StellarSorobanAuthorizedInvocationR\ni\
- nvocation\"_\n'StellarSorobanAuthorizationEnvelopeType\x124\n0ENVELOPE_T\
- YPE_SOROBAN_AUTHORIZATION_WITH_ADDRESS\x10\n\"c\n$StellarSorobanAuthoriz\
- ationSignature\x12\x1d\n\npublic_key\x18\x01\x20\x02(\x0cR\tpublicKey\
- \x12\x1c\n\tsignature\x18\x02\x20\x02(\x0cR\tsignature\"\x15\n\x13Stella\
- rTxExtRequest\"?\n\x0cStellarTxExt\x12\x0c\n\x01v\x18\x01\x20\x02(\x11R\
- \x01v\x12!\n\x0csoroban_data\x18\x02\x20\x01(\x0cR\x0bsorobanData*=\n\
- \x10StellarAssetType\x12\n\n\x06NATIVE\x10\0\x12\r\n\tALPHANUM4\x10\x01\
- \x12\x0e\n\nALPHANUM12\x10\x02B;\n#com.satoshilabs.trezor.lib.protobufB\
- \x14TrezorMessageStellar\
+ \"\xa7\x03\n\x19StellarContractIDPreimage\x12g\n\x04type\x18\x01\x20\x02\
+ (\x0e2S.hw.trezor.messages.stellar.StellarContractIDPreimage.StellarCont\
+ ractIDPreimageTypeR\x04type\x12}\n\x0cfrom_address\x18\x02\x20\x01(\x0b2\
+ Z.hw.trezor.messages.stellar.StellarContractIDPreimage.StellarContractID\
+ PreimageFromAddressR\x0bfromAddress\x1aT\n$StellarContractIDPreimageFrom\
+ Address\x12\x18\n\x07address\x18\x01\x20\x02(\tR\x07address\x12\x12\n\
+ \x04salt\x18\x02\x20\x02(\x0cR\x04salt\"L\n\x1dStellarContractIDPreimage\
+ Type\x12%\n!CONTRACT_ID_PREIMAGE_FROM_ADDRESS\x10\0\"\x04\x08\x01\x10\
+ \x01\"\xec\x01\n\x19StellarContractExecutable\x12g\n\x04type\x18\x01\x20\
+ \x02(\x0e2S.hw.trezor.messages.stellar.StellarContractExecutable.Stellar\
+ ContractExecutableTypeR\x04type\x12\x1b\n\twasm_hash\x18\x02\x20\x01(\
+ \x0cR\x08wasmHash\"I\n\x1dStellarContractExecutableType\x12\x1c\n\x18CON\
+ TRACT_EXECUTABLE_WASM\x10\0\"\x04\x08\x01\x10\x01\"\x04\x08\x02\x10\x02\
+ \"\xb2\x02\n\x1bStellarCreateContractArgsV2\x12g\n\x14contract_id_preima\
+ ge\x18\x01\x20\x02(\x0b25.hw.trezor.messages.stellar.StellarContractIDPr\
+ eimageR\x12contractIdPreimage\x12U\n\nexecutable\x18\x02\x20\x02(\x0b25.\
+ hw.trezor.messages.stellar.StellarContractExecutableR\nexecutable\x12S\n\
+ \x10constructor_args\x18\x03\x20\x03(\x0b2(.hw.trezor.messages.stellar.S\
+ tellarSCValR\x0fconstructorArgs\"\x88\x04\n\x20StellarSorobanAuthorizedF\
+ unction\x12u\n\x04type\x18\x01\x20\x02(\x0e2a.hw.trezor.messages.stellar\
+ .StellarSorobanAuthorizedFunction.StellarSorobanAuthorizedFunctionTypeR\
+ \x04type\x12V\n\x0bcontract_fn\x18\x02\x20\x01(\x0b25.hw.trezor.messages\
+ .stellar.StellarInvokeContractArgsR\ncontractFn\x12s\n\x1acreate_contrac\
+ t_v2_host_fn\x18\x03\x20\x01(\x0b27.hw.trezor.messages.stellar.StellarCr\
+ eateContractArgsV2R\x16createContractV2HostFn\"\x9f\x01\n$StellarSoroban\
+ AuthorizedFunctionType\x120\n,SOROBAN_AUTHORIZED_FUNCTION_TYPE_CONTRACT_\
+ FN\x10\0\x12?\n;SOROBAN_AUTHORIZED_FUNCTION_TYPE_CREATE_CONTRACT_V2_HOST\
+ _FN\x10\x02\"\x04\x08\x01\x10\x01\"\xe7\x01\n\"StellarSorobanAuthorizedI\
+ nvocation\x12X\n\x08function\x18\x01\x20\x02(\x0b2<.hw.trezor.messages.s\
+ tellar.StellarSorobanAuthorizedFunctionR\x08function\x12g\n\x0fsub_invoc\
+ ations\x18\x02\x20\x03(\x0b2>.hw.trezor.messages.stellar.StellarSorobanA\
+ uthorizedInvocationR\x0esubInvocations\"\xb3\x03\n\x13StellarHostFunctio\
+ n\x12[\n\x04type\x18\x01\x20\x02(\x0e2G.hw.trezor.messages.stellar.Stell\
+ arHostFunction.StellarHostFunctionTypeR\x04type\x12^\n\x0finvoke_contrac\
+ t\x18\x02\x20\x01(\x0b25.hw.trezor.messages.stellar.StellarInvokeContrac\
+ tArgsR\x0einvokeContract\x12e\n\x12create_contract_v2\x18\x03\x20\x01(\
+ \x0b27.hw.trezor.messages.stellar.StellarCreateContractArgsV2R\x10create\
+ ContractV2\"x\n\x17StellarHostFunctionType\x12&\n\"HOST_FUNCTION_TYPE_IN\
+ VOKE_CONTRACT\x10\0\x12)\n%HOST_FUNCTION_TYPE_CREATE_CONTRACT_V2\x10\x03\
+ \"\x04\x08\x01\x10\x01\"\x04\x08\x02\x10\x02\"\xda\x01\n\x20StellarSorob\
+ anAddressCredentials\x12\x18\n\x07address\x18\x01\x20\x02(\tR\x07address\
+ \x12\x14\n\x05nonce\x18\x02\x20\x02(\x12R\x05nonce\x12>\n\x1bsignature_e\
+ xpiration_ledger\x18\x03\x20\x02(\rR\x19signatureExpirationLedger\x12F\n\
+ \tsignature\x18\x04\x20\x02(\x0b2(.hw.trezor.messages.stellar.StellarSCV\
+ alR\tsignature\"\xeb\x01\n\x1fStellarSorobanDelegateSignature\x12\x18\n\
+ \x07address\x18\x01\x20\x02(\tR\x07address\x12F\n\tsignature\x18\x02\x20\
+ \x02(\x0b2(.hw.trezor.messages.stellar.StellarSCValR\tsignature\x12f\n\
+ \x10nested_delegates\x18\x03\x20\x03(\x0b2;.hw.trezor.messages.stellar.S\
+ tellarSorobanDelegateSignatureR\x0fnestedDelegates\"\xf9\x01\n-StellarSo\
+ robanAddressCredentialsWithDelegates\x12m\n\x13address_credentials\x18\
+ \x01\x20\x02(\x0b2<.hw.trezor.messages.stellar.StellarSorobanAddressCred\
+ entialsR\x12addressCredentials\x12Y\n\tdelegates\x18\x02\x20\x03(\x0b2;.\
+ hw.trezor.messages.stellar.StellarSorobanDelegateSignatureR\tdelegates\"\
+ \x86\x04\n\x19StellarSorobanCredentials\x12g\n\x04type\x18\x01\x20\x02(\
+ \x0e2S.hw.trezor.messages.stellar.StellarSorobanCredentials.StellarSorob\
+ anCredentialsTypeR\x04type\x12[\n\naddress_v2\x18\x02\x20\x01(\x0b2<.hw.\
+ trezor.messages.stellar.StellarSorobanAddressCredentialsR\taddressV2\x12\
+ \x7f\n\x16address_with_delegates\x18\x03\x20\x01(\x0b2I.hw.trezor.messag\
+ es.stellar.StellarSorobanAddressCredentialsWithDelegatesR\x14addressWith\
+ Delegates\"\xa1\x01\n\x1dStellarSorobanCredentialsType\x12&\n\"SOROBAN_C\
+ REDENTIALS_SOURCE_ACCOUNT\x10\0\x12\"\n\x1eSOROBAN_CREDENTIALS_ADDRESS_V\
+ 2\x10\x02\x12.\n*SOROBAN_CREDENTIALS_ADDRESS_WITH_DELEGATES\x10\x03\"\
+ \x04\x08\x01\x10\x01\"\xe4\x01\n\x20StellarSorobanAuthorizationEntry\x12\
+ W\n\x0bcredentials\x18\x01\x20\x02(\x0b25.hw.trezor.messages.stellar.Ste\
+ llarSorobanCredentialsR\x0bcredentials\x12g\n\x0froot_invocation\x18\x02\
+ \x20\x02(\x0b2>.hw.trezor.messages.stellar.StellarSorobanAuthorizedInvoc\
+ ationR\x0erootInvocation\"\xe3\x01\n\x1bStellarInvokeHostFunctionOp\x12%\
+ \n\x0esource_account\x18\x01\x20\x01(\tR\rsourceAccount\x12K\n\x08functi\
+ on\x18\x02\x20\x02(\x0b2/.hw.trezor.messages.stellar.StellarHostFunction\
+ R\x08function\x12P\n\x04auth\x18\x03\x20\x03(\x0b2<.hw.trezor.messages.s\
+ tellar.StellarSorobanAuthorizationEntryR\x04auth\"\x86\x06\n\x1fStellarS\
+ ignSorobanAuthorization\x12\x1b\n\taddress_n\x18\x01\x20\x03(\rR\x08addr\
+ essN\x12-\n\x12network_passphrase\x18\x02\x20\x02(\tR\x11networkPassphra\
+ se\x12\x88\x01\n\renvelope_type\x18\x03\x20\x02(\x0e2c.hw.trezor.message\
+ s.stellar.StellarSignSorobanAuthorization.StellarSorobanAuthorizationEnv\
+ elopeTypeR\x0cenvelopeType\x12\xaf\x01\n\"soroban_authorization_with_add\
+ ress\x18\x04\x20\x01(\x0b2b.hw.trezor.messages.stellar.StellarSignSoroba\
+ nAuthorization.StellarSorobanAuthorizationWithAddressR\x1fsorobanAuthori\
+ zationWithAddress\x1a\xf8\x01\n&StellarSorobanAuthorizationWithAddress\
+ \x12\x14\n\x05nonce\x18\x01\x20\x02(\x12R\x05nonce\x12>\n\x1bsignature_e\
+ xpiration_ledger\x18\x02\x20\x02(\rR\x19signatureExpirationLedger\x12\
+ \x18\n\x07address\x18\x03\x20\x02(\tR\x07address\x12^\n\ninvocation\x18\
+ \x04\x20\x02(\x0b2>.hw.trezor.messages.stellar.StellarSorobanAuthorizedI\
+ nvocationR\ninvocation\"_\n'StellarSorobanAuthorizationEnvelopeType\x124\
+ \n0ENVELOPE_TYPE_SOROBAN_AUTHORIZATION_WITH_ADDRESS\x10\n\"c\n$StellarSo\
+ robanAuthorizationSignature\x12\x1d\n\npublic_key\x18\x01\x20\x02(\x0cR\
+ \tpublicKey\x12\x1c\n\tsignature\x18\x02\x20\x02(\x0cR\tsignature\"\x15\
+ \n\x13StellarTxExtRequest\"?\n\x0cStellarTxExt\x12\x0c\n\x01v\x18\x01\
+ \x20\x02(\x11R\x01v\x12!\n\x0csoroban_data\x18\x02\x20\x01(\x0cR\x0bsoro\
+ banData*=\n\x10StellarAssetType\x12\n\n\x06NATIVE\x10\0\x12\r\n\tALPHANU\
+ M4\x10\x01\x12\x0e\n\nALPHANUM12\x10\x02B;\n#com.satoshilabs.trezor.lib.\
+ protobufB\x14TrezorMessageStellar\
";
/// `FileDescriptorProto` object which was a source for this generated file
@@ -11805,7 +12784,7 @@ pub fn file_descriptor() -> &'static ::protobuf::reflect::FileDescriptor {
let generated_file_descriptor = generated_file_descriptor_lazy.get(|| {
let mut deps = ::std::vec::Vec::with_capacity(1);
deps.push(super::messages_common::file_descriptor().clone());
- let mut messages = ::std::vec::Vec::with_capacity(41);
+ let mut messages = ::std::vec::Vec::with_capacity(45);
messages.push(StellarAsset::generated_message_descriptor_data());
messages.push(StellarGetAddress::generated_message_descriptor_data());
messages.push(StellarAddress::generated_message_descriptor_data());
@@ -11828,6 +12807,9 @@ pub fn file_descriptor() -> &'static ::protobuf::reflect::FileDescriptor {
messages.push(StellarSignedTx::generated_message_descriptor_data());
messages.push(StellarSCVal::generated_message_descriptor_data());
messages.push(StellarInvokeContractArgs::generated_message_descriptor_data());
+ messages.push(StellarContractIDPreimage::generated_message_descriptor_data());
+ messages.push(StellarContractExecutable::generated_message_descriptor_data());
+ messages.push(StellarCreateContractArgsV2::generated_message_descriptor_data());
messages.push(StellarSorobanAuthorizedFunction::generated_message_descriptor_data());
messages.push(StellarSorobanAuthorizedInvocation::generated_message_descriptor_data());
messages.push(StellarHostFunction::generated_message_descriptor_data());
@@ -11846,12 +12828,15 @@ pub fn file_descriptor() -> &'static ::protobuf::reflect::FileDescriptor {
messages.push(stellar_scval::StellarUInt256Parts::generated_message_descriptor_data());
messages.push(stellar_scval::StellarInt256Parts::generated_message_descriptor_data());
messages.push(stellar_scval::StellarSCValMapEntry::generated_message_descriptor_data());
+ messages.push(stellar_contract_idpreimage::StellarContractIDPreimageFromAddress::generated_message_descriptor_data());
messages.push(stellar_sign_soroban_authorization::StellarSorobanAuthorizationWithAddress::generated_message_descriptor_data());
- let mut enums = ::std::vec::Vec::with_capacity(8);
+ let mut enums = ::std::vec::Vec::with_capacity(10);
enums.push(StellarAssetType::generated_enum_descriptor_data());
enums.push(stellar_sign_tx::StellarMemoType::generated_enum_descriptor_data());
enums.push(stellar_set_options_op::StellarSignerType::generated_enum_descriptor_data());
enums.push(stellar_scval::StellarSCValType::generated_enum_descriptor_data());
+ enums.push(stellar_contract_idpreimage::StellarContractIDPreimageType::generated_enum_descriptor_data());
+ enums.push(stellar_contract_executable::StellarContractExecutableType::generated_enum_descriptor_data());
enums.push(stellar_soroban_authorized_function::StellarSorobanAuthorizedFunctionType::generated_enum_descriptor_data());
enums.push(stellar_host_function::StellarHostFunctionType::generated_enum_descriptor_data());
enums.push(stellar_soroban_credentials::StellarSorobanCredentialsType::generated_enum_descriptor_data());Why this scored 15/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.