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

Support random* Foundry cheatcodes as alias for fresh* #876

Open
palinatolmach opened this issue Nov 7, 2024 · 0 comments
Open

Support random* Foundry cheatcodes as alias for fresh* #876

palinatolmach opened this issue Nov 7, 2024 · 0 comments
Assignees

Comments

@palinatolmach
Copy link
Collaborator

palinatolmach commented Nov 7, 2024

We should support random* cheatcodes added as a fuzzing counterpart to fresh* ones to Foundry: https://github.com/foundry-rs/forge-std/blob/da591f56d8884c5824c0c1b3103fbcfd81123c4c/src/Vm.sol#L1729 in this PR.

One difference we need to address is the fact that

    function randomUint(uint256 bits) external view returns (uint256);

takes uint256 bits, not uint8 bytes, as Kontrol does with freshUint.

We'd also need to add

    function randomUint(uint256 min, uint256 max) external returns (uint256);

It would also require an update in kontrol-cheatcodes.

One other things to consider is that the signed version of randomInt has to be treated differently from freshInt — the latter is defined in kontrol-cheatcodes, but defining it there would introduce conflicts with forge-std.

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