Releases: foundry-rs/forge-std
v1.7.4
Featured Changes
- Update
Vm.sol
with changes toAccountAccessKind
by @emo-eth in #483.- This adds
Balance
,Extcodesize
,Extcodehash
,Extcodecopy
as account access kinds
- This adds
- feat: add new snapshot cheatcodes by @mattsse in #484.
- The
vm.revertTo(snapshotId)
cheat does not automatically delete thesnapshotId
snapshot, which can lead to unbounded memory growth with lots of snapshots. Therefore,vm.revertToAndDelete(snapshotId)
,vm.deleteSnapshot(snapshotId)
, andvm.deleteSnapshots()
were added as new cheats.
- The
Other Changes
Full Changelog: v1.7.3...v1.7.4
v1.7.3
Featured Changes
- feat: add
vm.startStateDiffRecording
andvm.stopAndReturnStateDiff
cheats to record all account accesses and storage accesses, by @Inphi in #481 - feat: add
vm.computeCreateAddress
andvm.computeCreate2Address
cheats, by @qiweiii in #479- These native cheats replace the need for the
StdUtils
methods of the same now, which will now give a deprecation warning when used.
- These native cheats replace the need for the
- feat: add mock contracts for ERC20 and ERC721, by @andreivladbrg in #470
- Be aware that these use initializers instead of constructors for compatibility across Solidity versions. Therefore it's recommended to use the
deployMockERC20
anddeployMockERC721
methods inStdUtils
to deploy them.
- Be aware that these use initializers instead of constructors for compatibility across Solidity versions. Therefore it's recommended to use the
Other Changes
New Contributors
- @Inphi made their first contribution in #481
- @qiweiii made their first contribution in #479
- @andreivladbrg made their first contribution in #470
Full Changelog: v1.7.2...v1.7.3
v1.7.2
Featured Changes
- feat: add
vm.loadAllocs(string)
cheatcode by @tynes in #474. This reads in a JSON file to directly set state for many accounts at once. - feat: add
vm.eth_getLogs
andvm.rpc
cheats by @Evalir in #475. Thevm.eth_getLogs
cheat makes aneth_getLogs
RPC call and returns the result, and thevm.rpc
cheat allows arbitrary RPC calls to be made. These query the current fork URL.
Other Changes
- fix: rely less on foundry internals by @DaniPopes in #473
- fix: test naming by @totomanov in #472
- chore: bump to v1.7.2 by @mds1 in #478
New Contributors
- @totomanov made their first contribution in #472
- @tynes made their first contribution in #474
Full Changelog: v1.7.1...v1.7.2
v1.7.1
v1.7.0
Featured Changes
- chore(BREAKING CHANGE): Change
exit_code
toexitCode
by @PaulRBerg in #458- This is a breaking change for any users who use the
exit_code
variable in theFfiResult
struct1
- This is a breaking change for any users who use the
- feat: add new
vm.serializeJson
cheatcode to the Vm and to StdJson by @vdrg in #453 - feat: add
vm.unixTime
toVmSafe
interface by @Tudmotu in #465 - perf: mark
vm.parseJsonKeys
as pure by @PaulRBerg in #460
Other Changes
Full Changelog: v1.6.1...v1.7.0
-
exit_code
was recently introduced, and a sourcegraph search did not reveal many existing users of it. Because this repo usescamelCase
, it was determined this breaking change was acceptable to keep things consistent, even though this technically does not follow semver. ↩
v1.6.1
Featured Changes
- feat: add cheatcodes and standard cheats to get keys of a mapping, by @clouds56, @Evalir, and @mds1 in #448 and #449
- feat: add
targetInterface()
helpers toStdInvariant
to allow targeting interfaces by @bernard-wagner in #445 - New filesystem cheats:
- feat: add
vm.copyFile
cheatcode by @DaniPopes in #431 - feat: add
vm.exists
,vm.isFile
andvm.isDir
by @ruvaag in #441
- feat: add
- New JSON parsing cheats:
- New chains in
StdChains
:- feat: add base goerli and base chains to
StdChains
by @giuseppecrj in #437 - feat: add moonbeam.network chains to
StdChains
by @klkvr in #426
- feat: add base goerli and base chains to
- feat:: add
vm.createWallet
,vm.sign
, andvm.getNonce
forWallet
struct by @trevorgjohnson in #435 - feat: add
vm.sleep(uint)
toVmSafe
interface by @Tudmotu in #438 - feat: add
vm.tryFfi
by @jrcarlos2000 in #443
Other Changes
- fix: restore inheritance order by @ZeroEkkusu in #425
- chore(
StdCheats
): deprecate changePrank by @Evalir in #434 - fix: assumeNotForgeAddress in StdCheats.sol by @ashhanai in #430
- chore: conform test naming to style guide by @Sabnock01 in #433
- chore: make json parse cheatcodes pure by @vdrg in #447
- fix(stdStorage): wrong slot id may returned by
find()
when slot value == 1337 by @paco0x in #446
New Contributors
- @klkvr made their first contribution in #426
- @trevorgjohnson made their first contribution in #435
- @ashhanai made their first contribution in #430
- @Tudmotu made their first contribution in #438
- @giuseppecrj made their first contribution in #437
- @ruvaag made their first contribution in #441
- @jrcarlos2000 made their first contribution in #443
- @vdrg made their first contribution in #447
- @bernard-wagner made their first contribution in #445
Full Changelog: v1.6.0...v1.6.1
v1.6.0
Featured Changes
- fix(tests): conform to upcoming
expectRevert
behavior by @Evalir in #379 — Read more about the upcoming forge v1 behavior here - feat: add
CallerMode
enum andvm.readCallers
cheat by @xeno097 in #400 - feat: add
deployCodeTo
StdCheat by @ZeroEkkusu in #401 - feat: add
vm.skip(bool)
cheat by @Evalir in #410 - feat: add
checked_write_int
forint256
toStdStorage
by @0xb10ckdev in #415 - feat: add
assumeAddressIsNot
StdCheats @Sabnock01 in #407
Other Changes
- chore: remove unused import by @paco0x in #392
- fix: improve DX by @ZeroEkkusu in #398
- ci: check for warnings by @ZeroEkkusu in #403
- ci: fix indentation by @mds1 in #408
- ci: remove dup step by @ZeroEkkusu in #413
- chore: bump to v1.6.0 by @mds1 in #417
New Contributors
- @paco0x made their first contribution in #392
- @xeno097 made their first contribution in #400
- @0xb10ckdev made their first contribution in #415
Full Changelog: v1.5.6...v1.6.0
v1.5.6
Featured Changes
- feat(cheats): add
vm.getLabel
cheatcode by @Evalir in #370 - feat(cheats): Add
vm.prevrandao
toVm.sol
by @Evalir in #377 - feat(cheats/stdCheats): add
destroyAccount
stdCheat (used to mimic self-destruct) andvm.setNonceUnsafe
andvm.resetNonce
cheats by @joaquinlpereyra in #389 - feat(stdCheats): add
boundPrivateKey
util by @PaulRBerg in #382 - feat(stdCheats): add
assumeNoBlacklisted
cheat by @PaulRBerg in #384 - feat(logs): pure
console.log
s by @0xdapper in #374 - feat(logs): add memory safe logging by @Philogy in #375
Other Changes
- perf: use staticcall instead of call by @PaulRBerg in #383
- chore(constants): add
Create2Factory
toCommonBase
by @Sabnock01 in #388 - feat(constants): add
SECP256K1_ORDER
constant by @PaulRBerg in #381 - chore: bump version to v1.5.6 by @mds1 in #391
New Contributors
- @Evalir made their first contribution in #370
- @Philogy made their first contribution in #375
- @joaquinlpereyra made their first contribution in #389
Full Changelog: v1.5.5...v1.5.6
v1.5.5
Featured Changes
- feat: add new filesystem cheatcodes and update existing ones, by @DaniPopes in #367
Other Changes
- ci: automatically sync
v1
release branch on new releases, by @PaulRBerg in #366 - test: comment out flaky test by @mds1 in #364
- chore: update infura keys by @mds1 in #368
- chore: bump to v1.5.5 by @mds1 in #369
New Contributors
- @DaniPopes made their first contribution in #367
Full Changelog: v1.5.4...v1.5.5
v1.5.4
Featured Changes
Breakpoints
Use vm.breakpoint(string calldata char)
and vm.breakpoint(string calldata char, bool value)
to set breakpoints when using the debugger. Jump to those breakpoints using '<char>
. The bool
overload lets you set conditional breakpoints.
More info:
- Find the cheats here.
- The two forge-std PRs by @iFrostizz: #357 and #358
Expect Zero or Many Calls
The vm.expectCall
cheats have a new overload that takes a count
, which is the number of times you expect that call to be made in the next call. Use a value of zero if you want to test that a call does not occur.
More info:
- Find the cheats here
- The forge-std PR by @reubenr0d in #360
Other Changes
- refactor: provide pure bound int that has no console.logs by @PaulRBerg in #350
- fix: removed unnecessary todo comment by @dd0sxx in #354
- docs: improve writing in StdChains comments by @PaulRBerg in #355
- chore: bump to v1.5.4 by @mds1 in #362
New Contributors
Full Changelog: v1.5.3...v1.5.4