-
Notifications
You must be signed in to change notification settings - Fork 72
feat: IProxy & Erc1967 #732
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
Conversation
Codecov ReportAttention: Patch coverage is
✅ All tests successful. No failed tests found. Additional details and impacted files
|
/// | ||
/// The success and return data of the delegated call will be returned back | ||
/// to the caller of the proxy. | ||
pub trait IProxy: TopLevelStorage + Sized { |
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.
This is a novel approach to implementing overridable contracts that I've been thinking about - we define the contract logic in the trait itself using default implementations. One other necessary component of the design is to access contract storage within the default fn impls through another ContractStorage
trait.
I'll be creating a draft PR soon to see if my idea is even doable with the current SDK, but if it works, this would open numerous possibilities for us:
- support for overridable functions
- we can do meaningful super traits with no problems
- remove the need for passing base contract impls as function parameters (see
Erc4626
) - we align perfectly with current trait-based inheritance model, while removing the need to reimplement every public function!
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.
Sounds interesting but I would not spend too much time on refactoring our codebase during M3. This milestone is too short, it would be better to bring more value (features).
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 like it!
No description provided.