Skip to content

How do I call a function in a different Move module / smart contract? #36

Answered by banool
banool asked this question in Questions
Discussion options

You must be logged in to vote

The problem

In order to publish a Move module that calls a function in another Move module, you need its source code. This is true of all Move modules, not just your own. You'll notice in Move.toml there is already a dependency on AptosFramework. This is what allows you to call all the framework functions, e.g. those related to coins, tokens, signer, timestamps, etc.

So to make this work, you need to have access to the source.

Source: Git Dependency

If you have access to the source in another git repository, you can tell the compiler where to find the other module by adding this to your Move.toml:

[dependencies.other]
git = 'https://github.com/banool/move-examples.git'
rev = 'main'
subdir…

Replies: 1 comment

Comment options

banool
Mar 7, 2024
Maintainer Author

You must be logged in to vote
0 replies
Answer selected by banool
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
move Questions related to the Move Language
1 participant