Move.

Publication

Partagez vos connaissances.

BigSneh.
Sep 06, 2025
Questions et Réponses avec des Experts

How to check if a specific function exists within a Move module at a given address?

I'm trying to figure out how to check if a specific function exists within a Move module at a given address in Move smart contract language, and if it does, call that function dynamically. Here's my scenario: I have a vector or array of addresses, and I need to determine whether a particular address has a specific function. If it does, I want to call that function dynamically.

Is there a way to achieve this in Move? I've been struggling to find a solution, and any guidance would be greatly appreciated.

  • Move CLI
  • Smart Contract
0
1
Partager
Commentaires
.

Réponses

1
290697tz.
Sep 6 2025, 05:17

Resolving dependencies at runtime, specifically checking for the existence of a function within a module dynamically, is not possible in Move. However, you can determine the existence of a specific resource at a particular address using exists(addr) (more details can be found in the documentation. It's important to note that the resource type T must be known at compile-time. Unfortunately, dynamically calling functions based on their existence within Move module at runtime is not supported in programming language.

If you have any questions, you can ask them here;

1
Meilleure réponse
Commentaires
.

Connaissez-vous la réponse ?

Veuillez vous connecter et la partager.

Move is an executable bytecode language used to implement custom transactions and smart contracts.

270Publications616Réponses
Sui.X.Peera.

Gagne ta part de 1000 Sui

Gagne des points de réputation et obtiens des récompenses pour avoir aidé la communauté Sui à se développer.