Hey team, i was trying to understand transfer policy, I see we need to use public_transfer to transfer store objects outside of the module but when i try to do transfer::transfer for store object from the same module where it is defined as shown below:
module 0x123::board {
use sui::object::UID;
use sui::transfer;
struct MyObj has key, store {
id: UID,
}
public fun transfer(object: MyObj, receiver: address) {
//should have been transfer::public_transfer(object, receiver);
transfer::transfer(object, receiver);
}
}
I am getting warning message saying:
public fun transfer(object: OwnedObject, receiver: address) {
│ ^^^^^^^^ ------ An instance of a module-private type with a store ability to be transferred coming from here
│ │
│ Potential unintended implementation of a custom transfer function.
10 │ transfer::transfer(object, receiver);
│ -------- Instances of a type with a store ability can be transferred using the public_transfer function which often negates the intent of enforcing a custom transfer policy
is it just the standard practice or what is the prime difference in this case?