# Is there a way to debug or test Move contracts that depend on modules only available on mainnet?

**URL:** <https://forums.sui.io/t/is-there-a-way-to-debug-or-test-move-contracts-that-depend-on-modules-only-available-on-mainnet/49010>\
**Category:** Move\
**Created:** [August 12, 2025, 5:04am UTC](https://forums.sui.io/t/is-there-a-way-to-debug-or-test-move-contracts-that-depend-on-modules-only-available-on-mainnet/49010 "2025-08-12T05:04:24Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![ice\_of\_ice](https://avatars.discourse-cdn.com/v4/letter/i/838e76/32.png) [@ice\_of\_ice](https://forums.sui.io/u/ice_of_ice)\
**Post date:** [August 12, 2025, 5:04am UTC](https://forums.sui.io/t/is-there-a-way-to-debug-or-test-move-contracts-that-depend-on-modules-only-available-on-mainnet/49010/1 "2025-08-12T05:04:25Z")

</div>

Is there a way to debug or test Move contracts that depend on modules only available on mainnet?

I’m running into the following error:

```auto
Error: MoveAbort(MoveLocation {
    module: ModuleId {
        address: 0000000000000000000000000000000000000000000000000000000000000002,
        name: Identifier("dynamic_field")
    },
    function: 11,
    instruction: 0,
    function_name: Some("borrow_child_object")
}, 1) in command 1

```

The problem is that my code uses multiple `dynamic_field` operations, and I can’t tell which part is actually causing this abort.

Has anyone found a good way to debug or trace this kind of error when the relevant modules are only deployed on mainnet?

---

<div class="post-metadata">

**Author:** ![taki](https://dub1.discourse-cdn.com/sui/user_avatar/forums.sui.io/taki/32/30736_2.png) [@taki](https://forums.sui.io/u/taki)\
**Post date:** [August 13, 2025, 4:00am UTC](https://forums.sui.io/t/is-there-a-way-to-debug-or-test-move-contracts-that-depend-on-modules-only-available-on-mainnet/49010/2 "2025-08-13T04:00:30Z")

</div>

Hi! You can do end-to-end debugging with `dryRun`:  
[https://docs.sui.io/sui-api-ref#sui\_dryruntransactionblock](https://docs.sui.io/sui-api-ref#sui_dryruntransactionblock)

From the error we know:

- The failure is in PTB command 1 (0-indexed)

- It’s coming from the dynamic\_field module with EFieldDoesNotExist (code 1)

If that command includes multiple `dynamic_field` accesses, check each access manually to pinpoint the exact failing call.

---

<div class="post-metadata">

**Author:** ![ice\_of\_ice](https://avatars.discourse-cdn.com/v4/letter/i/838e76/32.png) [@ice\_of\_ice](https://forums.sui.io/u/ice_of_ice)\
**Post date:** [August 17, 2025, 2:56pm UTC](https://forums.sui.io/t/is-there-a-way-to-debug-or-test-move-contracts-that-depend-on-modules-only-available-on-mainnet/49010/3 "2025-08-17T14:56:33Z")

</div>

If you try dryRun, it will show the same error - where it literally happens. No call stack or other information related to the execution of lines before the error.

---

<div class="post-metadata">

**Author:** ![ice\_of\_ice](https://avatars.discourse-cdn.com/v4/letter/i/838e76/32.png) [@ice\_of\_ice](https://forums.sui.io/u/ice_of_ice)\
**Post date:** [August 17, 2025, 5:59pm UTC](https://forums.sui.io/t/is-there-a-way-to-debug-or-test-move-contracts-that-depend-on-modules-only-available-on-mainnet/49010/4 "2025-08-17T17:59:35Z")

</div>

What I can think of now is dividing a whole function into smaller functions and call those functions in one execution. In this way, I can minimize the “suspicious” area in my code.
