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

Change vm visibility to internal in StdAssertions and StdUtils #530

Closed
smol-ninja opened this issue Mar 21, 2024 · 2 comments
Closed

Change vm visibility to internal in StdAssertions and StdUtils #530

smol-ninja opened this issue Mar 21, 2024 · 2 comments

Comments

@smol-ninja
Copy link

smol-ninja commented Mar 21, 2024

Currently, the visibility of vm in StdAssertions and StdUtils is private which means it cannot be use by the derived contract.

Vm private constant vm = Vm(address(uint160(uint256(keccak256("hevm cheat code")))));

VmSafe private constant vm = VmSafe(address(uint160(uint256(keccak256("hevm cheat code")))));

If we change it to internal, vm can be used directly with StdAssertions and StdUtils imports.

@smol-ninja smol-ninja changed the title Change vm visibility to internal in StdAssertions Change vm visibility to internal in StdAssertions and StdUtils Mar 25, 2024
@mds1
Copy link
Collaborator

mds1 commented Mar 25, 2024

This will cause a solc Identifer already declared error because we define vm as internal in CommonBase which is used by Test and Script. If you don't want to inherit from Test and Script you can instead inherit from CommonBase

@smol-ninja
Copy link
Author

Thank you @mds1 for your comment. That solves it.

@smol-ninja smol-ninja closed this as not planned Won't fix, can't repro, duplicate, stale Mar 25, 2024
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

2 participants