-
Notifications
You must be signed in to change notification settings - Fork 39
feat: support disabling token overwrite #362
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
base: main
Are you sure you want to change the base?
Conversation
75b46d0 to
709ddd9
Compare
zizou0x
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for this one! Just a few small comments
| for token in &self.disable_overwrite_tokens { | ||
| let overwrites = TokenProxyOverwriteFactory::new(*token, None); | ||
| balance_overwrites.extend(overwrites.get_overwrites()) | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't understand how this works, why do we need to create an empty overwrite factory? Can't we just remove entries from balance_overwrites?
| if self | ||
| .disable_overwrite_tokens | ||
| .contains(&addr) | ||
| { | ||
| continue; | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can't we just remove them from the overwrites but keep balances stored?
This is because people will expect this to contain all the balances, it's a bit shady that we have this edge case that makes them being ignored.
| let potential_rebase_tokens: HashSet<Address> = if let Some(bytes) = snapshot | ||
| .component | ||
| .static_attributes | ||
| .get("rebase_tokens") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I find this name weird, I'll think about it but I think we should make it more obvious what it is
No description provided.