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

Thoughts on creating a "StdConstants" contract? #267

Open
PaulRBerg opened this issue Jan 5, 2023 · 3 comments
Open

Thoughts on creating a "StdConstants" contract? #267

PaulRBerg opened this issue Jan 5, 2023 · 3 comments

Comments

@PaulRBerg
Copy link
Contributor

Would you be open to a PR that separated the constants defined in CommonBase in a separate contract StdConstants, which CommonBase would then inherit from?

@mds1
Copy link
Collaborator

mds1 commented Jan 5, 2023

Hmm, what's the rationale for it? I would lean towards keeping constants in CommonBase to avoid over-abstracting things.

Currently all Std* contracts are independent of CommonBase, so this suggestion would also break that convention

@PaulRBerg
Copy link
Contributor Author

PaulRBerg commented Jan 5, 2023

Well, simply being able to inherit from StdConstants and make use of the constants defined in Foundry without also getting the vm and the stdstore variables. I can't do this currently because I'm using PRBTest.

Good point re convention, I didn't consider that.

I guess, I don't have a strong opinion here. Copy-pasting the constants that I need is not a big chore, not at all, so I'm happy to close this as not planned if you can't think of any easy solution that would at the same not break the contract independence convention and would make it possible to re-use the constants in Test contract equivalents.

@Sabnock01
Copy link
Contributor

There are a few constants from CommonBase that wound up being implemented in Std* files like UINT256_MAX in StdUtils.sol. Some minor duplication to think about.

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

3 participants