shxdow
shxdow

Reputation: 31

How can I invoke functions from on-chain modules in my Move module if no sources are available?

This question explains how to invoke functions from different modules when source code is available. But what if it isn't ? I'm trying to interact with a lending protocol on Sui and I'm trying to call a specific function (https://naviprotocol.gitbook.io/navi-protocol-developer-docs/contract-interface/modules/incentive_v2#entry_borrow). Source code is not freely available but I can see from the explorer https://suiscan.xyz/mainnet/object/0x7c9b90b3fda0fa4aa8ee88ae6c4a0b83c773f74936b5354448cb94662e94442d that functions are there.

If I do as suggested in the question above I get unbound module error:

error[E03002]: unbound module
  ┌─ sources/att:3:9
  │
3 │     use 0xd899cf7d2b5db716bd2cf55599fb0d5ee38a3061e7b6bb6eebf73fa5bc4c81ca::incentive_v2::{Self};
  │         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Invalid 'use'. Unbound module: '0xD899CF7D2B5DB716BD2CF55599FB0D5EE38A3061E7B6BB6EEBF73FA5BC4C81CA::incentive_v2'

This is my module:

module 0xCAFE::att {

    use 0xd899cf7d2b5db716bd2cf55599fb0d5ee38a3061e7b6bb6eebf73fa5bc4c81ca::incentive_v2::{Self};
    public entry fun run() {
    }
}

How am I supposed to successfully compile it ?

Upvotes: 0

Views: 112

Answers (0)

Related Questions