Skip to content

Refactor(registry): Optimize Profile Avatar URI Storage [SC-003]#410

Merged
ONEONUORA merged 8 commits into
Fracverse:masterfrom
TochukwuJustice:profile-avatar
Jun 26, 2026
Merged

Refactor(registry): Optimize Profile Avatar URI Storage [SC-003]#410
ONEONUORA merged 8 commits into
Fracverse:masterfrom
TochukwuJustice:profile-avatar

Conversation

@TochukwuJustice

Copy link
Copy Markdown
Contributor

closes #276

Summary of changes:
Removed the monolithic ADDRESS_TO_AVATAR map storage approach.
Introduced a strongly-typed DataKey::Avatar(Address) enum.
Refactored update_profile and get_avatar in the User Registry contract to directly read and write avatar URIs using granular composite storage keys.

Reason for the changes:
The previous implementation utilized a single global Map to store every user's avatar. This meant that every profile update would load the entire platform's userbase into memory, update one entry, and serialize the entire Map back to persistent storage. This refactor changes the space and time complexity for avatar lookups/updates to a lean $O(1)$, significantly reducing gas costs and preventing the contract from hitting Soroban ledger limits as it scales.

@drips-wave

drips-wave Bot commented Jun 25, 2026

Copy link
Copy Markdown

@TochukwuJustice Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@ONEONUORA ONEONUORA left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great job @TochukwuJustice
Thank you for your contribution

@ONEONUORA
ONEONUORA merged commit 67bc630 into Fracverse:master Jun 26, 2026
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[SC-003] Implement profile avatar URI update function in Registry

2 participants