You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Support `random*` cheatcodes except for `randomInt` for signed ints
* `randomUInt` signature fix
* Add remaining `random*` cheatcodes
* Add `random*` tests to end-to-end tests
* Fix capitalization in `randomUInt`
* Fix `bytes` rules, fix `randomInt` test typo
* Fix `uint8` signature
* Update `randomBytes` implementation, leave passing tests for the first PR
* Add `test_randomUint_Range`
* Add `randomUint(uint256,uint256)` implementation
* Fix implementation for `randomUint256Range`
* Fix `test_randomUint_192` name in `end-to-end-prove-all`
* Minor cleanup in `cheatcodes.md`
* Add a test for `vm.randomUint()`
* Fix `test_randomUint_Range(uint256,uint256)` signature
* Fix whitespaces in rules one
Co-authored-by: Andrei Văcaru <16517508+anvacaru@users.noreply.github.com>
* Fix whitespaces in rules two
Co-authored-by: Andrei Văcaru <16517508+anvacaru@users.noreply.github.com>
* Rename `randomUintWidth` rule, add descriptions for other rules
---------
Co-authored-by: Andrei Văcaru <16517508+anvacaru@users.noreply.github.com>
Copy file name to clipboardExpand all lines: src/kontrol/kdist/cheatcodes.md
+92-5Lines changed: 92 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -121,7 +121,7 @@ function deal(address who, uint256 newBalance) external;
121
121
```
122
122
123
123
`cheatcode.call.deal` will match when the `deal` cheat code function is called.
124
-
The rule then takes from the function call data the target account, using `#asWord(#range(ARGS, 0, 32)`, and the new balance, using `#asWord(#range(ARGS, 32, 32))`, and forwards them to the `#setBalance` production which updates the account accordingly.
124
+
The rule then takes from the function call data the target account, using `#asWord(#range(ARGS, 0, 32))`, and the new balance, using `#asWord(#range(ARGS, 32, 32))`, and forwards them to the `#setBalance` production which updates the account accordingly.
125
125
126
126
```k
127
127
rule [cheatcode.call.deal]:
@@ -378,20 +378,67 @@ This rule returns a symbolic integer of up to the bit width that was sent as an
378
378
[preserves-definedness]
379
379
```
380
380
381
+
#### `randomUint` - Returns a single symbolic unsigned integer of a given size.
382
+
383
+
```
384
+
function randomUint() external returns (uint256);
385
+
function randomUint(uint256) external returns (uint256);
386
+
function randomUint(uint256,uint256) external returns (uint256);
387
+
```
388
+
389
+
`cheatcode.call.randomUintWidth` will match when the `randomUint(uint256)` cheat code function is called.
390
+
This rule returns a symbolic integer of up to the bit width that was sent as an argument.
0 commit comments