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

feat(cheatcodes): Add vm.prevrandao to Vm.sol #373

Closed
wants to merge 0 commits into from

Conversation

Evalir
Copy link
Member

@Evalir Evalir commented May 6, 2023

src/Vm.sol Outdated
Comment on lines 353 to 356
// Sets block.difficulty
function difficulty(uint256 newDifficulty) external;
// Sets block.prevrandao
function prevrandao(bytes32 newPrevrandao) external;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are these aliases for each other or will they revert depending on the EVM version you have selected in foundry.toml? If the latter, might be nice to document that in the comments here

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, actually, that's a great point—these will fail silently depending on which EVM version you have. They've not been configured/changed to revert (and REVM does not fail either). We should probably update these to have this behavior

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds good, I'll hold off on merging this in the meantime then if you think that change will be ready soon

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Following up with foundry-rs/foundry#4904

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With foundry-rs/foundry#4904 merged, @Evalir do you mind pushing a commit to tweak these comments so they're a bit more self-documenting?

@Evalir
Copy link
Member Author

Evalir commented May 11, 2023

Ah shoot closed this accidentally by updating my fork. Will reopen

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

Successfully merging this pull request may close these issues.

2 participants