Skip to content

refactor(token): optimize DataKey storage layout#156

Open
Richiey1 wants to merge 3 commits into
BCPathway:mainfrom
Richiey1:fix/storage-optimization
Open

refactor(token): optimize DataKey storage layout#156
Richiey1 wants to merge 3 commits into
BCPathway:mainfrom
Richiey1:fix/storage-optimization

Conversation

@Richiey1
Copy link
Copy Markdown

This PR optimizes the DataKey storage layout in the token contract to reduce gas consumption and storage fees on Soroban.

Summary of changes:

  • Assigned explicit, small integer discriminants to all DataKey enum variants. This ensures that the storage keys use the most compact representation possible.
  • Cleaned up redundant variants and dead code in the lib.rs file to improve maintainability and further reduce the contract size.
  • Verified logic consistency for allowances and balances.

Closes #70

@drips-wave
Copy link
Copy Markdown

drips-wave Bot commented May 30, 2026

@Richiey1 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

- Remove orphaned test function signatures that caused rustfmt to fail
@Richiey1 Richiey1 force-pushed the fix/storage-optimization branch from eb5fd78 to 5d1ad47 Compare June 2, 2026 17:37
@Richiey1
Copy link
Copy Markdown
Author

Richiey1 commented Jun 2, 2026

Hi maintainers! 👋

I've pushed the latest fixes to address the dependency conflicts and test errors:

  • Optimized the DataKey storage layout for gas reduction.
  • Standardized the Cargo.toml dependencies to align with soroban-sdk v22.0.11 and resolved the e2e workspace conflicts.
  • Fixed the syntax errors and unclosed delimiters in the token tests.

Could you please re-run the CI checks from your end and take a look at the changes? Let me know if there's anything else needed! Thanks.

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.

[Contract] Optimize Storage Keys for Gas Reduction

1 participant