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

Inheritance at the template level #500

Open
Tracked by #396
blmalone opened this issue Jan 29, 2025 · 0 comments
Open
Tracked by #396

Inheritance at the template level #500

blmalone opened this issue Jan 29, 2025 · 0 comments

Comments

@blmalone
Copy link
Contributor

Supporting inheritance at the template level would be useful if we wanted to reuse code from templates. For example, lets say we have a GasConfigTemplate that we want to inherit from and add additional functionality. Right now, this can't be done because the functions that are overridden.

contract A {
    function foo() internal pure virtual returns (string[] memory);
}

contract B is A {
    function foo() internal pure virtual override returns (string[] memory) {
        // This function is currently not virtual but can be.
    }
}

contract C is B {
    function foo() internal pure override returns (string[] memory) {
        // Further override - for additional features. 
    }
}
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

No branches or pull requests

1 participant