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

inline docs standardized, and emit removed from set_allowance #87

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

ozgunozerk
Copy link
Collaborator

Fixes #86

Also, whilst standardizing events and errors, I've noticed something and tinkered with it.

set_allowance() function is taking a flag as a parameter on whether to emit an event or not.

I've followed the every path to set_allowance(), and noticed the this flag is only set to true (event is emitted) when it is called by the approve() function.

I believe set_allowance is there to provide the low-level logic for setting the allowance. And approve() function is the high-level one, which should be responsible from:

  • authorization
  • event emission

So, I moved the event responsibility to approve() function, and the code logic became simpler and shorter as well in return.

@brozorec please let me know if this change will have a downside that I didn't think of yet.

@ozgunozerk ozgunozerk added the documentation Improvements or additions to documentation label Feb 27, 2025
@ozgunozerk ozgunozerk requested a review from brozorec February 27, 2025 14:43
@ozgunozerk ozgunozerk self-assigned this Feb 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
Status: Todo
Development

Successfully merging this pull request may close these issues.

Standardize error and event inline documentation
1 participant