Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding Diamond Storage to Auth & Election Storage #7

Closed
Ronnieraj37 opened this issue Jan 29, 2024 · 0 comments
Closed

Adding Diamond Storage to Auth & Election Storage #7

Ronnieraj37 opened this issue Jan 29, 2024 · 0 comments

Comments

@Ronnieraj37
Copy link
Contributor

Ronnieraj37 commented Jan 29, 2024


name: Adding Diamond Storage to Auth & Election Storage
about: Implementing diamond storage on current elections & auth

Describe the purpose
The Current data state's implementation of Authentication.sol & ElectionStorage.sol uses the default storage ways for storing user data & the elections.
Screenshot 2024-01-30 at 12 39 11 AM
Screenshot 2024-01-30 at 12 39 19 AM
This standard way of storage is pointless as it breaks the purpose of diamond upgradability which works on shared storage.

Possible Implementation

We can use the official Diamond Storage which accesses a memory slot in the contract.
Screenshot 2024-01-30 at 12 42 15 AM

Additional context To implement this we access the data slots the same way LibDiamond.sol reads & allocates storage slots for functionToFacet selector in diamond. Below is an example implementation of how this works.
Screenshot 2024-01-30 at 12 46 21 AM
-> I was thinking of implemeting this storage contract only on Authentication and ElectionStorage.sol as these 2 Contracts cover the user and election data and the rest contracts are brought from the elections storage.

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

No branches or pull requests

1 participant