{"templateId":"markdown","versions":[{"version":"v1.40","label":"v1.40 STS","link":"/products/custody/transactions/smart-contracts/api","default":true,"active":false,"folderId":"c15a2701"},{"version":"v1.39","label":"v1.39 STS","link":"/products/custody/v1.39/transactions/smart-contracts/api","default":false,"active":false,"folderId":"c15a2701"},{"version":"v1.38","label":"v1.38 STS","link":"/products/custody/v1.38/transactions/smart-contracts/api","default":false,"active":true,"folderId":"c15a2701"},{"version":"v1.34","label":"v1.34 LTS","link":"/products/custody/v1.34/transactions/smart-contracts/api","default":false,"active":false,"folderId":"c15a2701"},{"version":"v1.26","label":"v1.26 LTS","link":"/products/custody/v1.26/transactions/smart-contracts/api","default":false,"active":false,"folderId":"c15a2701"},{"version":"v1.19","label":"v1.19 LTS","link":"/products/custody/v1.19/transactions/smart-contracts/api","default":false,"active":false,"folderId":"c15a2701"},{"version":"v1.15","label":"v1.15 LTS","link":"/products/custody/v1.15/transactions/smart-contracts/api","default":false,"active":false,"folderId":"c15a2701"}],"sharedDataIds":{"sidebar":"sidebar-products/custody/@v1.15/sidebars.yaml"},"props":{"metadata":{"markdoc":{"tagList":["admonition","partial"]},"type":"markdown"},"seo":{"title":"Work with smart contracts","description":"User guides, API reference, and support resources.","siteUrl":"https://docs.ripple.com","lang":"en-US","llmstxt":{"hide":false,"sections":[{"title":"Table of contents","includeFiles":["**/*"],"excludeFiles":[]}],"excludeFiles":[]}},"dynamicMarkdocComponents":[],"compilationErrors":[],"ast":{"$$mdtype":"Tag","name":"article","attributes":{},"children":[{"$$mdtype":"Tag","name":"Heading","attributes":{"level":1,"id":"work-with-smart-contracts","__idx":0},"children":["Work with smart contracts"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["You can deploy and call smart contracts on ledgers with smart contract support."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["For more information, see ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/products/custody/v1.38/reference/supported-ledgers"},"children":["Supported blockchain ledgers"]},"."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["All of the information needed for the smart contract is encoded in the application binary interface (ABI) data."]},{"$$mdtype":"Tag","name":"Admonition","attributes":{"type":"info","name":"Tip!"},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["You can also deploy smart contracts as ABI data in JSON format associated with an endpoint. For more information, see ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/products/custody/v1.38/accounts-and-assets/endpoints/manage-endpoints#register-an-endpoint-with-the-api"},"children":["Register endpoints"]},"."]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"deploy-a-smart-contract-on-an-evm-ledger","__idx":1},"children":["Deploy a smart contract on an EVM ledger"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["You can deploy new smart contracts on EVM ledgers."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"prerequisites","__idx":2},"children":["Prerequisites"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["To deploy a smart contract on an EVM ledger, you need the following:"]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Prerequisite"},"children":["Prerequisite"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Additional information"},"children":["Additional information"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["An account on an EVM ledger from which to deploy the contract"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/products/custody/v1.38/accounts-and-assets/accounts/manage-accounts-api#view-account-details"},"children":["View account details"]}]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Enough funds in the account to cover the transaction fees and the amount"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/products/custody/v1.38/accounts-and-assets/accounts/manage-accounts-api#check-account-balances"},"children":["Check account balances"]}]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["The ABI data for the contract, in bytecode format"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["The following new IDs, in a standard UUID format:",{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["A transaction order ID"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["An intent ID"]}]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[]}]}]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"deploy-the-smart-contract","__idx":3},"children":["Deploy the smart contract"]},{"$$mdtype":"Tag","name":"Admonition","attributes":{"type":"info","name":"System change process"},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["All new requests to change the system state follow the same process. To familiarize yourself with this process first, see ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/products/custody/v1.38/governance/intents/manage-intents-and-approvals"},"children":["Manage intents and approvals"]},"."]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["To deploy a smart contract, follow the steps in ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/products/custody/v1.38/governance/intents/manage-intents-and-approvals"},"children":["Manage intents and approvals"]},", with a payload similar to the following example."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"payload-example","__idx":4},"children":["Payload example"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"json","header":{"controls":{"copy":{}}},"source":"{\n    \"payload\": {\n        \"id\": \"a67365ca-ce15-4b22-bb37-72aed5f93657\",\n        \"accountId\": \"bc9a3d6d-a6e5-4c1c-9058-40ba7ee9ead0\",\n        \"parameters\": {\n            \"destination\": null,\n            \"data\": \"0x...\",\n            \"amount\": \"0\",\n            \"feeStrategy\": {\n                \"type\": \"Priority\",\n                \"priority\": \"Medium\"\n            },\n            \"maximumFee\": \"2187025000000000\",\n            \"type\": \"Ethereum\"\n        },\n        \"type\": \"v0_CreateTransactionOrder\"\n    },\n}\n","lang":"json"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Fields of the ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["payload"]}," block to note are as follows:"]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Field"},"children":["Field"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Description"},"children":["Description"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["accountId"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Internal account ID of an existing Ethereum account in ","Ripple Custody","."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["parameters.destination"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Destination address of the smart contract. This is a standard address on the blockchain, so set this field to ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["null"]},"."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["parameters.data"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["ABI data of the smart contract in EVM bytecode format. The data can include multiple smart contracts."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["parameters.amount"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["If the constructor is ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["payable"]},", you can specify an amount, in Wei, to deduct from the account specified in ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["accountId"]}," to be used to fund the balance of the smart contract."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["parameters.feeStrategy"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["The fee strategy to use for the transaction. For more information, see ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/products/custody/v1.38/transactions/reference#fee-strategy-and-maximum-fee"},"children":["Fee strategy and maximum fee"]},"."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["parameters.maximumFee"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["The maximum fee, in Wei. For more information, see ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/products/custody/v1.38/transactions/reference#fee-strategy-and-maximum-fee"},"children":["Fee strategy and maximum fee"]},"."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["parameters.type"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Ledger type, in this case ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["Ethereum"]},"."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["type"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["v0_CreateTransactionOrder"]}]}]}]}]}]},{"$$mdtype":"Tag","name":"Admonition","attributes":{"type":"success"},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["When the transaction order is successfully approved, ","Ripple Custody"," does the following:"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Creates a transaction, to broadcast the details and register the smart contract on the blockchain."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Creates one or more transfers, to represent the separate amounts associated with the transaction, such as the cryptocurrency amount and the fees."]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"view-the-smart-contract-details","__idx":5},"children":["View the smart contract details"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["To view the smart contract details:"]},{"$$mdtype":"Tag","name":"ol","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Get details of the transaction entity created for the transaction order, as described in ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/products/custody/v1.38/transactions/viewing-assets/view-and-audit-api#view-transactions-for-a-transaction-order"},"children":["View transactions for a transaction order"]},"."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Check the transaction entity, as described in ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/products/custody/v1.38/governance/intents/manage-intents-and-approvals#check-state-with-the-api"},"children":["Check the entity"]},"."]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The response body returned is similar to the following example:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"json","header":{"controls":{"copy":{}}},"source":"{\n    \"id\": \"a4614cce-80e1-453a-a064-c092b27d89ee\",\n    \"ledgerId\": \"ethereum-testnet\",\n    \"orderReference\": {\n        \"id\": \"137bc5db-b88d-43c2-a54f-2d7780e5bcd9\",\n        \"domainId\": \"f457833d-d734-4ef2-b185-a7f2c795b3d6\"\n    },\n    \"relatedAccounts\": [\n        {\n            \"id\": \"bc9a3d6d-a6e5-4c1c-9058-40ba7ee9ead0\",\n            \"domainId\": \"f457833d-d734-4ef2-b185-a7f2c795b3d6\",\n            \"sender\": true\n        }\n    ],\n    \"processing\": {\n        \"status\": \"Completed\"\n    },\n    \"registeredAt\": \"2023-03-15T13:49:25.606Z\",\n    \"ledgerTransactionData\": {\n        \"ledgerStatus\": \"Confirmed\",\n        \"failure\": null,\n        \"ledgerTransactionId\": \"0x6b12478f131ad3e851aa58c95c7a3abb151b6cc32dd0d90dd1d76d622d549dce\",\n        \"rawTransaction\": \"0x02f920e305...\",\n        \"statusLastUpdatedAt\": \"2023-03-15T14:14:50.623Z\",\n        \"ledgerData\": {\n            \"logs\": [],\n            \"createdContractAddresses\": [\n                \"0x7a09ce2981fb6a056b4b51c679e6457b2119bc4a\"\n            ],\n            \"type\": \"Ethereum\"\n        }\n    }\n}\n","lang":"json"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["ledgerTransactionData"]}," block includes the following fields:"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["ledgerData.createdContractAddresses"]},": A list of created contract addresses."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["ledgerData.deletedContractAddresses"]},": A list of deleted contract addresses."]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"call-an-evm-smart-contract","__idx":6},"children":["Call an EVM smart contract"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["You can call an EVM smart contract to trigger the specific action encoded in the contract, such as transfer of an asset."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"prerequisites-1","__idx":7},"children":["Prerequisites"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["To call a smart contract on an Ethereum ledger, you need the following:"]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Prerequisite"},"children":["Prerequisite"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Additional information"},"children":["Additional information"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["An account on an Ethereum ledger from which to call the contract"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/products/custody/v1.38/accounts-and-assets/accounts/manage-accounts-api#view-account-details"},"children":["View account details"]}]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Enough funds in the account to cover the transaction fees and the amount"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/products/custody/v1.38/accounts-and-assets/accounts/manage-accounts-api#check-account-balances"},"children":["Check account balances"]}]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["The contract address"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"#view-the-smart-contract-details"},"children":["View the smart contract details"]}]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["The ABI data of the contract"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"#view-the-smart-contract-details"},"children":["View the smart contract details"]}]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["The following new IDs, in a standard UUID format:",{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["A transaction order ID"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["An intent ID"]}]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[]}]}]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"call-the-smart-contract","__idx":8},"children":["Call the smart contract"]},{"$$mdtype":"Tag","name":"Admonition","attributes":{"type":"info","name":"System change process"},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["All new requests to change the system state follow the same process. To familiarize yourself with this process first, see ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/products/custody/v1.38/governance/intents/manage-intents-and-approvals"},"children":["Manage intents and approvals"]},"."]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["To call an Ethereum smart contract, follow the steps in ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/products/custody/v1.38/governance/intents/manage-intents-and-approvals"},"children":["Manage intents and approvals"]},", with a payload similar to the following example."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"payload-example-1","__idx":9},"children":["Payload example"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"json","header":{"controls":{"copy":{}}},"source":"{\n    \"payload\": {\n        \"id\": \"a67365ca-ce15-4b22-bb37-72aed5f93657\",\n        \"accountId\": \"bc9a3d6d-a6e5-4c1c-9058-40ba7ee9ead0\",\n        \"parameters\": {\n            \"destination\": {\n                \"address\": \"0x9983f755bbd60d1886cbfe103c98c272aa0f03d6\",\n                \"type\": \"Address\"\n            },\n            \"amount\": \"0\",\n            \"feeStrategy\": {\n                \"priority\": \"Medium\",\n                \"type\": \"Priority\"\n            },\n            \"maximumFee\": \"2187025000000000\",\n            \"data\": \"0x...\",\n            \"type\": \"Ethereum\"\n}\n","lang":"json"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Fields of the ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["payload"]}," block to note are as follows:"]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Field"},"children":["Field"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Description"},"children":["Description"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["accountId"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Internal account ID of an existing Ethereum account in ","Ripple Custody","."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["parameters.destination"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Details of the destination to be used by the smart contract."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["parameters.data"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["ABI data to interact with the smart contract, in EVM bytecode format."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["parameters.amount"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["If the constructor is ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["payable"]},", you can specify an amount, in Wei, to deduct from the account specified in ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["accountId"]}," to be used to fund the balance of the smart contract."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["parameters.feeStrategy"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["The fee strategy to use for the transaction. For more information, see ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/products/custody/v1.38/transactions/reference#fee-strategy-and-maximum-fee"},"children":["Fee strategy and maximum fee"]},"."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["parameters.maximumFee"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["The maximum fee, in Wei. For more information, see ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/products/custody/v1.38/transactions/reference#fee-strategy-and-maximum-fee"},"children":["Fee strategy and maximum fee"]},"."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["parameters.type"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Ledger type, in this case ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["Ethereum"]},"."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["type"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["v0_CreateTransactionOrder"]}]}]}]}]}]},{"$$mdtype":"Tag","name":"Admonition","attributes":{"type":"success"},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["When the transaction order is successfully approved, ","Ripple Custody"," does the following:"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Creates a transaction, to broadcast the details on the blockchain."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Creates one or more transfers, to represent the separate amounts associated with the transaction, such as the cryptocurrency amount and the fees."]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"query-an-evm-smart-contract","__idx":10},"children":["Query an EVM smart contract"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["You can query an EVM smart contract in read-only mode. You do not need to authenticate or pay a fee for this call."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"prerequisites-2","__idx":11},"children":["Prerequisites"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["To query a smart contract on an EVM ledger, you need the following:"]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Prerequisite"},"children":["Prerequisite"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Additional information"},"children":["Additional information"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["An account on an Ethereum ledger from which to call the contract"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/products/custody/v1.38/accounts-and-assets/accounts/manage-accounts-api#view-account-details"},"children":["View account details"]}]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["The contract address"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"#view-the-smart-contract-details"},"children":["View the smart contract details"]}]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["The ABI data needed to interact with the contract, in bytecode format"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[]}]}]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"query-the-smart-contract","__idx":12},"children":["Query the smart contract"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["To query the smart contract, call the ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/products/custody/v1.38/reference/api/openapi/ledgers/processethereumcontractcall"},"children":["Process contract call"]}," operation, with a payload similar to the following example."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"payload-example-2","__idx":13},"children":["Payload example"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"json","header":{"controls":{"copy":{}}},"source":"{\n    \"contractAddress\": \"0xb2F701a94D864b131Fd47c9cf4563e6298AFDBfC\",\n    \"from\": {\n        \"address\": \"0xd0fe99113224600b369be3bd4a2e8b4a901ea1be\",\n        \"type\": \"Address\"\n    },\n    \"value\": \"0\",\n    \"data\": \"0x70a08231000000000000000000000000d6afa2cd61297abf4763aab4cfd2bed30f7c5a2a\"\n}\n","lang":"json"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["This ABI data includes a call to the ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["balanceOf"]}," method. This produces the following response, which is the balance amount in hexadecimal format:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"header":{"controls":{"copy":{}}},"source":"\"0x0000000000000000000000000000000000000000000000036b5e854dc150800c\"\n"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"call-a-tezos-smart-contract","__idx":14},"children":["Call a Tezos smart contract"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["You can call a Tezos smart contract to trigger the specific action encoded in the contract, such as transfer of an asset."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"prerequisites-3","__idx":15},"children":["Prerequisites"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["To call a smart contract on a Tezos ledger, you need the following:"]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Prerequisite"},"children":["Prerequisite"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Additional information"},"children":["Additional information"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["An account on a Tezos ledger from which to call the contract"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/products/custody/v1.38/accounts-and-assets/accounts/manage-accounts-api#view-account-details"},"children":["View account details"]}]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Enough funds in the account to cover the transaction fees and the amount"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/products/custody/v1.38/accounts-and-assets/accounts/manage-accounts-api#check-account-balances"},"children":["Check account balances"]}]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["The contract address"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"#view-the-smart-contract-details"},"children":["View the smart contract details"]}]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["The data needed to interact with the contract"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["The following new IDs, in a standard UUID format:",{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["A transaction order ID"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["An intent ID"]}]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[]}]}]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"call-the-smart-contract-1","__idx":16},"children":["Call the smart contract"]},{"$$mdtype":"Tag","name":"Admonition","attributes":{"type":"info","name":"System change process"},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["All new requests to change the system state follow the same process. To familiarize yourself with this process first, see ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/products/custody/v1.38/governance/intents/manage-intents-and-approvals"},"children":["Manage intents and approvals"]},"."]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["To call a Tezos smart contract, follow the steps in ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/products/custody/v1.38/governance/intents/manage-intents-and-approvals"},"children":["Manage intents and approvals"]},", with a payload similar to the following example."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"payload-example-3","__idx":17},"children":["Payload example"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"json","header":{"controls":{"copy":{}}},"source":"{\n    \"payload\": {\n        \"id\": \"953d75b2-e384-46e9-8a72-a1ce753a50e2\",\n        \"accountId\": \"0bb0b283-da9e-4789-b134-cb5edde472a8\",\n        \"parameters\": {\n            \"operation\": {\n                \"destination\": {\n                    \"address\": \"KT1Nf5LibLx8pod61a1476sefSWyddiwLkPg\",\n                    \"type\": \"Address\"\n                },\n                \"amount\": \"0\",\n                \"contractParameters\": {\n                    \"value\": \"ff05726573657400000002030b\",\n                    \"type\": \"Raw\"\n                },\n                \"type\": \"Transaction\"\n            },\n            \"feeStrategy\": {\n                \"priority\": \"Low\",\n                \"type\": \"Priority\"\n            },\n            \"maximumFee\": \"10000\",\n            \"type\": \"Tezos\"\n        },\n        \"customProperties\": {},\n        \"type\": \"v0_CreateTransactionOrder\"\n    }\n}\n","lang":"json"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Fields of the ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["payload"]}," block to note are as follows:"]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Field"},"children":["Field"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Description"},"children":["Description"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["accountId"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Internal account ID of an existing Tezos account in ","Ripple Custody","."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["parameters.operation.destination"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Details of the destination to be used by the smart contract."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["parameters.operation.contractParameters"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["A string to call the smart contract."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["parameters.maximumFee"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["The maximum fee, in micro tez. For more information, see ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/products/custody/v1.38/transactions/reference#fee-strategy-and-maximum-fee"},"children":["Fee strategy and maximum fee"]},"."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["parameters.type"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Ledger type, in this case ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["Tezos"]},"."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["type"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["v0_CreateTransactionOrder"]}]}]}]}]}]},{"$$mdtype":"Tag","name":"Admonition","attributes":{"type":"success"},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["When the transaction order is successfully approved, ","Ripple Custody"," does the following:"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Creates a transaction, to broadcast the details on the blockchain."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Creates one or more transfers, to represent the separate amounts associated with the transaction, such as the cryptocurrency amount and the fees."]}]}]}]},"headings":[{"value":"Work with smart contracts","id":"work-with-smart-contracts","depth":1},{"value":"Deploy a smart contract on an EVM ledger","id":"deploy-a-smart-contract-on-an-evm-ledger","depth":2},{"value":"Prerequisites","id":"prerequisites","depth":3},{"value":"Deploy the smart contract","id":"deploy-the-smart-contract","depth":3},{"value":"Payload example","id":"payload-example","depth":4},{"value":"View the smart contract details","id":"view-the-smart-contract-details","depth":3},{"value":"Call an EVM smart contract","id":"call-an-evm-smart-contract","depth":2},{"value":"Prerequisites","id":"prerequisites-1","depth":3},{"value":"Call the smart contract","id":"call-the-smart-contract","depth":3},{"value":"Payload example","id":"payload-example-1","depth":4},{"value":"Query an EVM smart contract","id":"query-an-evm-smart-contract","depth":2},{"value":"Prerequisites","id":"prerequisites-2","depth":3},{"value":"Query the smart contract","id":"query-the-smart-contract","depth":3},{"value":"Payload example","id":"payload-example-2","depth":4},{"value":"Call a Tezos smart contract","id":"call-a-tezos-smart-contract","depth":2},{"value":"Prerequisites","id":"prerequisites-3","depth":3},{"value":"Call the smart contract","id":"call-the-smart-contract-1","depth":3},{"value":"Payload example","id":"payload-example-3","depth":4}],"frontmatter":{"seo":{"title":"Work with smart contracts"}},"lastModified":"2026-07-27T10:10:43.000Z","pagePropGetterError":{"message":"","name":""}},"slug":"/products/custody/v1.38/transactions/smart-contracts/api","userData":{"isAuthenticated":false,"teams":["anonymous"]},"isPublic":true}