Releases: foundry-rs/forge-std
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
v1.5.3
Featured Changes
- feat: Add new
vm.expectSafeMemory
cheats by @clabby in #327 - feat: add
Account
helper struct to StdCheats by @jameswenzel in #331 - fix(StdAssertions): % is not displayed as % by @0xdapper in #336
- feat: add
vm.mockCallRevert
cheatcode by @reubenr0d in #337 - feat: add
vm.txGasPrice
cheat by @mds1 in #341 - chore: bump DS Test version to add
assertNotEq
assertion helpers by @0xGuybrush in #339
Other Changes
- feat: name emitter in "expectEmit" by @PaulRBerg in #329
- ♻️ Remove Unused Function Parameters in
StdAssertions.t.sol
by @pcaversaccio in #328 - fix: initialize function collision by @brotherlymite in #333
- Fixed a typo in StdUtils.sol by @Iaroslav-Mazur in #340
- chore: bump to v1.5.3 by @mds1 in #342
New Contributors
- @brotherlymite made their first contribution in #333
- @0xdapper made their first contribution in #336
- @reubenr0d made their first contribution in #337
- @Iaroslav-Mazur made their first contribution in #340
- @0xGuybrush made their first contribution in #339
Full Changelog: v1.5.2...v1.5.3
v1.5.2
What's Changed
- fix:
src/
and all subdirectories now included when installing this package with yarn directly from GitHub. by @EdouardBougon in #324
New Contributors
- @EdouardBougon made their first contribution in #324
Full Changelog: v1.5.1...v1.5.2
v1.5.1
What's Changed
- feat: add "changePrank" variant by @PaulRBerg in #319
- feat: add simple "expectEmit" by @PaulRBerg in #320
Full Changelog: v1.5.0...v1.5.1
v1.5.0
Featured Changes
- feat: add
StdStyle
library to print logs with different colors and styles,by @wirew0lf in #313- Example usage:
console2.log(StdStyle.red("my red string"))
- Available method names are
red
,green
,yellow
,blue
,magenta
,cyan
,bold
,italic
,underline
,dim
, andinverse
- Example usage:
- Rename
StdAssertions.sol
logs fromactual
andexpected
toleft
andright
, to make it easier to read failed assertions, by @Sabnock01 in #290 - feat(StdCheats): add
dealERC721
anddealERC1155
cheats by @wirew0lf in #305 - feat(StdAssertions): add
assertEqCall
assertion helpers by @0xPhaze in #311 - feat(Vm): Add new
expectCall
variants to assert on the amount of gas passed to a call, by @clabby in #310
Other Changes
- Bump ds-test and complete assertion log renaming by @Sabnock01 in #307
New Contributors
- @Sabnock01 made their first contribution in #290
- @clabby made their first contribution in #310
- @wirew0lf made their first contribution in #313
- @0xPhaze made their first contribution in #311
Full Changelog: v1.4.0...v1.5.0
v1.4.0
Featured Changes
- refactor(BREAKING CHANGE): rename InvariantTest to StdInvariant and have Test inherit from it by default by @mds1 in #292
- Add create2 helper methods
computeCreate2Address
andhashInitCode
by @karmacoma-eth in #276 - Add flag disable default rpc with
setFallbackToDefaultRpcUrls(bool)
by @hexonaut in #291
Other Changes
- refactor: rename "who" arg to "msgSender" by @PaulRBerg in #277
- Just a minor change to stay consistent with the helpful comment by @FredCoen in #278
- ci: remove key that doesn't work by @mds1 in #284
- chore: use coercion cheatcodes with stdJson helpers by @odyslam in #294
- chore: bump to v1.4.0 by @mds1 in #300
Full Changelog: v1.3.0...v1.4.0
v1.3.0
Featured Changes
- feat (BREAKING CHANGE): Usability Updates for
StdChains
by @hexonaut in #268. This is a breaking change for some users, check out the PR for more info. - feat: Add
InvariantTest
helper contract by @lucas-manuel in #261. Use it via inheritance, e.g.contract MyInvariantTests is Test, InvariantTest
- feat: add
IMulticall3
interface andgetTokenBalances
helper by @PaulRBerg in #271 - feat: add
MULTICALL3_ADDRESS
in CommonBase by @PaulRBerg in #266 - feat: add new
assumePayable
cheat by @hexcowboy in #270 - feat: add
assertApproxEqAbsDecimal
andassertApproxEqRelDecimal
assertions by @aaoferreira in #191 - feat:
parseJson
cheatcodes with type coercion by @odyslam in #274
Other Changes
- refactor: use simple revert instead of "require(false" by @PaulRBerg in #265
- Fix compiler warnings by @PaulRBerg in #260
New Contributors
- @lucas-manuel made their first contribution in #261
- @aaoferreira made their first contribution in #191
- @hexonaut made their first contribution in #268
- @hexcowboy made their first contribution in #270
Full Changelog: v1.2.0...v1.3.0
v1.2.0
Featured Changes
Breaking Changes
- Significantly improved via-ir compilation times with #235 by @ZeroEkkusu. Update your code to use the new
getChain
methods, such asgetChain("mainnet")
orgetChain(1)
Additional Changes
- feat: Add gas metering cheatcodes + modifier by @brockelmore in #248
- feat: add envOr cheatcodes to Vm interface #3732 by @vicnaum in #249
- feat: implement boundInt by @JhChoy in #253
- chore: add fsMetadata cheat by @mds1 in #251
- feature: isFork and skip modifiers in StdCheats by @prestwich in #236
- feat: improve StdChains by @adhusson in #247
- feat: add common addresses by @mds1 in #229
Other Changes
- ♻️ chore: add MIT license to interfaces by @pcaversaccio in #243
- ci: print forge version in CI by @mds1 in #242
- fix: remove StdStorage in CommonBase contract by @graykode in #241
- fix: remove
StdChains
fromStdCheatsSafe
by @ZeroEkkusu in #245 - Name arguments in Vm.sol by @PaulRBerg in #246
- fix: remove
Components.sol
by @ZeroEkkusu in #255 - chore: bump version to v1.2.0 (the upcoming release) by @mds1 in #228
- fix: move cheats, improve docs by @ZeroEkkusu in #256
New Contributors
- @prestwich made their first contribution in #236
- @graykode made their first contribution in #241
- @vicnaum made their first contribution in #249
- @JhChoy made their first contribution in #253
Full Changelog: v1.1.1...v1.2.0
v1.1.1
What's Changed
- Fix unexpected condition in
bound
by @Rubilmax in #220 - Fix IERC1155 Interface name by @jameswenzel in #223
- fix: swap default mainnet RPC URL by @mds1 in #227
- refactor: move bytesToUint to StdUtils for shared use by @NoahMarconi in #222
- chore: bump version to v1.1.1 by @mds1 in #234
New Contributors
- @Rubilmax made their first contribution in #220
- @NoahMarconi made their first contribution in #222
Full Changelog: v1.1.0...v1.1.1
v1.1.0
Featured Changes
Breaking Changes
- Fix slow compilation with
via-ir
by @mds1 in #217. Make sure to update usagestdChains
from the formstdChains.Mainnet.chainId
tostdChains["mainnet"].chainId
Other Changes
- Feat: add serialize (vm.writeJson) to stdjson by @odyslam in #213
- feat: add emitter to Log struct by @davidiola in #214
Other Changes
- chore:
forge fmt
by @ZeroEkkusu in #203 - docs: fix ci badge by @ZeroEkkusu in #202
- Use relative imports in interfaces for VSCode linting compatibility by @jameswenzel in #206
- restrict cheats mutability by @adhusson in #205
- fix: ds-test imports + compiler warnings by @mds1 in #210
- chore: remove
\
, updateds-test
by @ZeroEkkusu in #216 - fix: add signature for bytes by @odyslam in #218
New Contributors
- @jameswenzel made their first contribution in #206
- @adhusson made their first contribution in #205
- @davidiola made their first contribution in #214
Full Changelog: v1.0.0...v1.1.0