-
Notifications
You must be signed in to change notification settings - Fork 11.8k
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
ERC20Snapshot should use hooks #2283
Comments
Technically this is a breaking change. Realistically, I don't think we can commit to never adding new overrides. I think that justifies adding the new I don't think this qualifies as a bug really. |
Heh sorry, I missclicked on the bug tag. I think your reasoning is sound. We should probably add a section to the hooks docs where we explain what to do if there are conflicting definitions for the hook and the user must manually override them, including the expected error message so hopefully googling for it takes people there. |
Yes, we do have the "Using Hooks" section but including the error message would be very useful for searchability. |
I meant that that guide tells you how to write hooks, but not what to do in the case of having to provide an override due to multiple inheritance. |
@nventuro @frangio took a shot on the functionality. Let me know how it looks, I will take a look at the Docs change as well. @nventuro when you talk about explaining what to do with confilcts with multiple inheritance you mean doing something like this?
|
More or less, except our recommendation is to use |
As of v3.1-rc.0,
ERC20Snapshot
is implemented by overriding_transfer
,_mint
, and_burn
. This is problematic because it causes multiple inheritance issues for users that extend from both Snapshot and any other ERC20-based contract (e.g.ERC20Burnable
).We should use the hooks mechanism instead to implement this:
It's not clear to me to what extent this would be considered API breakage. @frangio thoughts?
The text was updated successfully, but these errors were encountered: