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

feat(Grants): paginate storage and remove max grant limit #52

Merged
merged 1 commit into from
Sep 3, 2024

Conversation

aliXsed
Copy link
Collaborator

@aliXsed aliXsed commented Aug 29, 2024

Rmove the maximum grants limit which could create undesired consequences when an address is spammed. However we need to paginate the storage to keep the cost of iterating over all the grants for functions like claim, cancel and renounce limited and predictable. For convenience of the contract users we assume startPage == endPage == 0 means iterate over all the pages (which could make sense if the user already knows this wouldn't be too expensive.

NOTE: we are not defragmenting the storage when some schedules are removed from a page. This means the number of items in every page would be variable but always less than or equal the pageLimit.

@aliXsed aliXsed marked this pull request as ready for review August 29, 2024 02:33
@aliXsed aliXsed merged commit a76f669 into main Sep 3, 2024
1 check passed
@aliXsed aliXsed deleted the aliX/grants-extra-sec branch September 3, 2024 02:53
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.

1 participant