Move.

Expert Q&A

Ask Move community experts

Posts

119
  • yhant3.
    Apr 07, 2025
    Expert Q&A

    How to ensure only NFT owner can transfer it in a contract?

    Hey everyone! I'm working on implementing an NFT contract and want to make sure that only the rightful owner of the NFT can transfer it. I have this function for transferring: public fun transfer( nft: DevNetNFT, recipient: address, _: &mut TxContext ) { transfer::public_transfer(nft, recipient) } Is this checking done within the public_transfer method, or do I need to add additional logic?

    • Move CLI
    0
    3
  • Britain.
    Apr 07, 2025
    Expert Q&A

    How to fetch values from ObjectTable using Dynamic Fields?

    I'm trying to fetch values from an ObjectTable using Dynamic Fields from the frontend, but I'm encountering an error with dynamicFieldObject. The error says Unexpected arg String("gms") for the expected type Struct(MoveStructLayout...). How can I get the correct type for the value and avoid this error?

    • Move CLI
    • Move
    0
    3
  • Raju.
    Raju158
    Apr 06, 2025
    Expert Q&A

    How to test a function with a Receiving parameter in Sui?

    I'm trying to test the receive_object function with a Receiving parameter in Sui based on the docs at this link. Initially, I created a test using the example, but I'm struggling with how to get the sent argument to be a Receiving type. I've also tried denoting the receiving type, but encountered errors. Could someone guide me on properly testing this function?

    • Move CLI
    • Move
    0
    4
  • Santorini.
    Apr 06, 2025
    Expert Q&A

    How can I copy a vector<u64> to use multiple times?

    I'm trying to copy a vector into a local variable because I need two instances of the same vector for my project. I've seen some methods, but I'm not entirely sure how to implement them correctly. Can anyone guide me on the best practices or methods to achieve this in the Move programming language?

    • Move CLI
    • Move
    0
    4
  • yhant3.
    Apr 05, 2025
    Expert Q&A

    How to concatenate strings in Move language?

    I'm trying to concatenate two strings using the Move programming language. Can someone guide me on how to do this?

    • Move CLI
    • Move
    0
    1
  • BlueEyedCrypto.
    Apr 04, 2025
    Expert Q&A

    How to fix 'Unbound module' error for deployed Move package?

    I'm using the router_addr package and trying to call a function from my new package. Despite it being deployed on the network, I'm getting an error saying Unbound module 'router_addr::router'. How do I resolve this error?

    • Move CLI
    0
    2
  • Bolke .
    Apr 02, 2025
    Expert Q&A

    Can you use randomness in non-entry public functions in Move?

    I'm new to using randomness in Move programming. The documentation suggests using random only in entry functions. However, I'm considering using randomness to set values, not for branching code. Is it okay to use randomness in a public function in this way?

    • Move CLI
    • Move
    1
    1
    Best Answer
  • Santorini.
    Apr 01, 2025
    Expert Q&A

    Why does Rust enum with Box create cycle warning even with phantom?

    I'm working with Rust and I have the following code: public enum Expr { Apply(Box, Box), } It seems like I'm getting a cycle warning because Expr contains Box. However, I'm using phantom types, and I thought that would make it safe to compile. Can someone explain why this cycle warning is happening despite using phantom types?

    • Move CLI
    • Move
    2
    1
    Best Answer
  • doodee.
    Apr 01, 2025
    Expert Q&A

    Can you get a timestamp when an object is created in Move?

    Hey there! I'm working with Move and I'm curious if it's possible to get a timestamp of when an object is created. I've seen something about using sui::clock to capture this, but I was wondering if there's a native way to access this timestamp directly in Move code without additional attributes or if we can avoid additional computations. Any insights?

    • Move CLI
    • Move
    2
    2
  • tomek.
    Mar 30, 2025
    Expert Q&A

    Difference between mutable and non-mutable shared objects in Move?

    Hey, I'm kinda new to Move lang, and I got a bit confused about the differences between mutable shared objects and non-mutable shared objects. What exactly sets these two apart?

    • Move CLI
    • Move
    1
    1
    Best Answer
Sui.X.Peera.

Earn Your Share of 1000 Sui

Gain Reputation Points & Get Rewards for Helping the Sui Community Grow.

Top tags
  • Move CLI
  • Move
  • Move Bug
  • Move Module
  • Move Script
  • Smart Contract
  • Move Prover
  • Feature Request
We use cookies to ensure you get the best experience on our website.
More info