How to call another function (A contract ) by (B contract) on chain #271
-
Discord user ID.yue. Describe your question in detail.I want to use a function by another contract not using SDK , "from move "What error, if any, are you getting?No response What have you tried or looked at? Or how can we reproduce the error?think? Which operating system are you using?macOS Which SDK or tool are you using? (if any)N/A Describe your environment or tooling in detailNo response |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 3 replies
-
ok |
Beta Was this translation helpful? Give feedback.
-
Hey Yue, If the source code for a module is not available, you can use the contract's bytecode as a dependency to utilize its functions in your module. To download the contract's bytecode, use the following command: aptos move download --bytecode --account <account_address_where_contract_is_deployed> --package <package_name> After downloading, add the downloaded folder as a dependency in your Additionally, you can decompile the bytecode using this command: aptos move decompile --package-path <path_to_folder_with_.mv_files> For more detailed guidance, you can follow this official guide. |
Beta Was this translation helpful? Give feedback.
Hey @yue1823, you can see active usage of third party dependencies here.
Specifically, this
Move.toml
will contain examples of sourcing from both a local file (PancakeSwap) and a git repo (Liquidswap).