[Feature Request]: Add #[view] annotation to object::is_owner function #15294
Labels
enhancement
New feature or request
stale-exempt
Prevents issues from being automatically marked and closed as stale
🚀 Feature Request
Add the
#[view]
annotation to theis_owner
function in theaptos_framework::object
module to enable off-chain querying of object ownership status.Motivation
Is your feature request related to a problem? Please describe.
The
is_owner
function in theobject
module is a read-only function that checks if a given address is the owner of a specific object. However, it currently lacks the#[view]
annotation, which means it cannot be used in view functions or called directly from off-chain applications to check ownership status.This limitation forces developers to either:
#[view]
annotationAdding the
#[view]
annotation would allow for more efficient and direct ownership queries without requiring state modifications or additional gas costs.Pitch
Describe the solution you'd like
Add the
#[view]
annotation to the existingis_owner
function:This change would:
Describe alternatives you've considered
However, adding the
#[view]
annotation to the existing function is the most straightforward and maintainable solution, as it:Are you willing to open a pull request?
Yes, I can open a pull request for this change if the feature request is approved.
Additional context
This change aligns with Aptos' goal of improving developer experience and reducing unnecessary transaction costs. Similar read-only functions in other modules (like
account::exists_at
) already use the#[view]
annotation, making this change consistent with existing patterns in the framework.The text was updated successfully, but these errors were encountered: