Expert Q&A
Ask Move community experts
Posts
119- Expert Q&Ayhant3251Apr 07, 2025
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
03 - Expert Q&ABritain92Apr 07, 2025
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
03 - Expert Q&ARaju158Apr 06, 2025
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
04 - Expert Q&AApr 06, 2025
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
04 - Expert Q&Ayhant3251Apr 05, 2025
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
01 - Expert Q&AApr 04, 2025
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
02 - Expert Q&ABolke 88Apr 02, 2025
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
11Best Answer - Expert Q&AApr 01, 2025
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
21Best Answer - Expert Q&Adoodee105Apr 01, 2025
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
22 - Expert Q&Atomek180Mar 30, 2025
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
11Best Answer
- Move CLI
- Move
- Move Bug
- Move Module
- Move Script
- Smart Contract
- Move Prover
- Feature Request