Post
Share your knowledge.
How to import a deployed package in Move contract?
I'm trying to import a deployed coin package into my Move smart contract for receiving payments, but I keep getting an 'Unbound module' error when I add the address in the Move.toml file. Can anyone provide a guide or examples on how to correctly set up imports for deployed packages?
- Move CLI
- Move
Answers
2Each Sui project has a Move.lock file, which contains the deployment address of your package. You need to use this address for your specific network to ensure your Move.toml file correctly references the deployed package . If you're dealing with a deployed coin, you could manually obtain the source code from a blockchain explorer to use locally if the repository isn't publicly available. This way, you point to the local code in your Move.toml and set the package's address as per its mainnet deployment .
To import a deployed package, you need to ensure that the package is properly specified as a dependency in your Move.toml file. This can involve adding a local path to where you have the package's code or a git repository link if it's available online. If the package is on-chain, you might need to have a local copy of the package's code since the Move compiler requires the source code to correctly compile and verify dependencies .
Do you know the answer?
Please log in and share it.
Move is an executable bytecode language used to implement custom transactions and smart contracts.

- ... SUIderiss+5
- ... SUIRamirez+5
- ... SUIElvin CLONE +5
- ... SUI
- ... SUI
- ... SUI
- ... SUIBritain+2