Releases: foundry-rs/forge-std
Releases · foundry-rs/forge-std
v1.9.7
Featured changes
- Add
ERC7540
andERC7575
interfaces by @hieronx in #644 - Add
StdConstants
library by @CodeSandwich in #654 - Add
ERC-6909
interface by @n3m6 in #664 - Add new
accessList
,warmSlot
,coolSlot
+cool
cheatcodes by @grandizzy in #670 - add
interceptInitcode
cheatcode by @grandizzy in #675
Other changes
- feat: update cheatcodes by @grandizzy in #673
- chore: add hoodi testnet by @StackOverflowExcept1on in #672
- chore: use named imports by @milosdjurica in #659
- feat: update cheatcodes by @StackOverflowExcept1on in #678
New Contributors
- @hieronx made their first contribution in #644
- @CodeSandwich made their first contribution in #654
- @n3m6 made their first contribution in #664
- @StackOverflowExcept1on made their first contribution in #672
Full Changelog: v1.9.6...v1.9.7
v1.9.6
Breaking Changes
- deprecated
deployMockERC721
anddeployMockERC20
fromStdUtils
(#643)
Featured Changes
- Fixing Variable Shadowing in Solidity: uint256 Redeclaration Error by @Guayaba221 in #636
- feat: new cheatcode
assumeUnusedAddress
by @xenide in #639 - OP Networks Add by @ElliotFriedman in #646
- test: remove
testFail*
tests by @zerosnacks in #643
Other changes
- chore: update
Vm.sol
to the latest version by @zerosnacks in #647 - chore: update to
1.9.6
by @zerosnacks in #648
New Contributors
- @Guayaba221 made their first contribution in #636
- @ElliotFriedman made their first contribution in #646
Full Changelog: v1.9.5...v1.9.6
v1.9.5
Featured Changes
- feat: get broadcasts by @yash-atreya in #627
- feat: mockCall overloads by @yash-atreya in #630
- fix: use
vm.getBlockTimestamp
forskip
andrewind
by @xenide in #634 - feat:
count
assertion forexpectRevert
by @yash-atreya in #638 - feat: count assertions for expectEmit by @yash-atreya in #640
Other changes
- test: don't expect a specific cheatcode error message by @DaniPopes in #632
- chore: update to latest cheatcodes by @grandizzy in #633
- chore: update Vm.sol by @zerosnacks in #641
- chore: bump to
v1.9.5
by @grandizzy in #642
New Contributors
Full Changelog: v1.9.4...v1.9.5
v1.9.4
Featured Changes
- feat: add gas snapshot cheatcodes by @zerosnacks in #614
- feat: add additional random value cheatcodes and mocking cheatcodes by @Tudmotu in #615
- feat: add
debugTraceRecording
,getScriptWallets
,breakpoint
, andcloneAccount
cheats by @boolafish in #621 - feat: add
rememberKeys
cheats by @yash-atreya in #622 - feat: add
getWallets
cheatcode by @yash-atreya in #620 - fix: update snapshot cheatcodes by @zerosnacks in #613
Other changes
- Add
--from
option to vm.py, to generate Vm.sol from json file by @Tudmotu in #619 - chore: add contribution guide and document
scripts/vm.py
by @zerosnacks in #618 - chore: add guidance on running compatibility checks locally by @zerosnacks in #623
- chore: bump to v1.9.4 by @mds1 in #625
New Contributors
- @boolafish made their first contribution in #621
Full Changelog: v1.9.3...v1.9.4
v1.9.3
Featured Changes
- feat: add
publicKeyP256
,pauseTracing
, andresumeTracing
cheatcodes by @grandizzy in #596 - feat: add
resetGasMetering
andexpectPartialRevert
cheatcodes by @grandizzy in #597 - feat:
setArbitraryStorage
,copyStorage
,mockFunction
andassumeNoRevert
by @grandizzy in #602 - feat: add
keyExists
and default parsing methods to stdJson and stdToml by @mds1 in #605 - feat: add
getArtifactPathBy{,Deployed}Code
,parseTomlType
,expect{,Partial}Revert(..., address)
,skip(bool, string)
, andrandom{Bool,Bytes,Int}
by @DaniPopes in #610
Other Changes
- fix: fix assume not precompile by @tynes in #594
- feat: flare mainnet/testnet rpc support by @Uttam-Singhh in #595
- chore: renaming tests to follow best practices from Foundry Book by @milosdjurica in #600
- docs: docs fix spelling issues by @nnsW3 in #609
- chore: use correct console signatures by @DaniPopes in #606
- chore: bump version 1.9.3 by @mattsse in #611
New Contributors
- @Uttam-Singhh made their first contribution in #595
- @milosdjurica made their first contribution in #600
- @nnsW3 made their first contribution in #609
Full Changelog: v1.9.2...v1.9.3
v1.9.2
Featured Changes
- fix:
logMemory
insafeconsole
now works as expected by @Philogy in #591 - New cheats added across various PRs
- List of new cheats can be found by looking at this diff. Note that some cheats were re-organized in foundry-rs/foundry#8578, so not all cheats that show as added are new.
- PRs that added them to forge-std:
- feat: update vm interface with new cheats by @lightclient in #582
- feat: add
broadcastRawTransaction
cheatcode by @zerosnacks in #587 - new cheats + v1.9.2 by @mds1 in #593
Other Changes
New Contributors
- @lightclient made their first contribution in #582
Full Changelog: v1.9.1...v1.9.2
v1.9.1
Featured Changes
- fix: add missing console logs by @DaniPopes in #577
Other Changes
Full Changelog: v1.9.0...v1.9.1
v1.9.0
Featured Changes
- feat: deprecate console2 by @DaniPopes in #573
- feat(cheatcode):
vm.promptSecretUint
cheat by @DhairyaSethi in #566 - feat:
vm.randomAddress
andvm.randomUint
cheats by @mds1 in #572 - feat: add invariant excludeSelector helper by @grandizzy in #569
Other Changes
- chore: remove duplicate interface by @stevennevins in #560
- New chains in standard chains:
- feat: add blast goerli & blast chaindata setup by @CruzMolina in #558
- feat: add fantom to default chains by @sujithsomraaj in #568
- feat: 🎸 New Berachain V2 bArtio Testnet by @codingwithmanny in #571
- chore: bump to v1.9.0 by @mds1 in #575
New Contributors
- @CruzMolina made their first contribution in #558
- @stevennevins made their first contribution in #560
- @DhairyaSethi made their first contribution in #566
- @sujithsomraaj made their first contribution in #568
- @grandizzy made their first contribution in #569
- @codingwithmanny made their first contribution in #571
Full Changelog: v1.8.2...v1.9.0
v1.8.2
Featured Changes
- Add
vm.prompt
cheatcodes to Vm interface by @Tudmotu in #529 - chore(networks): goerli sunset by @sambacha in #525
- feat: Add support for polygon amoy testnet by @kcyeu in #540
- feat: add all new cheats to interface by @mds1 in #549
- add: blobhashes cheats by @yash-atreya in #553
- fix(StdInvariant): correct
targetArtifactSelector
type by @DaniPopes in #524 - feat(vm): add ensNamehash cheatcode by @meetmangukiya in #555
Expand to see the full set of new cheats
/// Gets the environment variable `name` and returns true if it exists, else returns false.
function envExists(string calldata name) external view returns (bool result);
/// Returns true if `forge` command was executed in given context.
function isContext(ForgeContext context) external view returns (bool result);
/// Gets the current `block.blobbasefee`.
/// You should use this instead of `block.blobbasefee` if you use `vm.blobBaseFee`, as `block.blobbasefee` is assumed to be constant across a transaction,
/// and as a result will get optimized out by the compiler.
/// See https://github.com/foundry-rs/foundry/issues/6180
function getBlobBaseFee() external view returns (uint256 blobBaseFee);
/// Gets the gas used in the last call.
function lastCallGas() external view returns (Gas memory gas);
/// Signs `digest` with signer provided to script using the secp256k1 curve.
/// If `--sender` is provided, the signer with provided address is used, otherwise,
/// if exactly one signer is provided to the script, that signer is used.
/// Raises error if signer passed through `--sender` does not match any unlocked signers or
/// if `--sender` is not provided and not exactly one signer is passed to the script.
function sign(bytes32 digest) external pure returns (uint8 v, bytes32 r, bytes32 s);
/// Signs `digest` with signer provided to script using the secp256k1 curve.
/// Raises error if none of the signers passed into the script have provided address.
function sign(address signer, bytes32 digest) external pure returns (uint8 v, bytes32 r, bytes32 s);
/// Prompts the user for a string value in the terminal.
function prompt(string calldata promptText) external returns (string memory input);
/// Prompts the user for an address in the terminal.
function promptAddress(string calldata promptText) external returns (address);
/// Prompts the user for a hidden string value in the terminal.
function promptSecret(string calldata promptText) external returns (string memory input);
/// Prompts the user for uint256 in the terminal.
function promptUint(string calldata promptText) external returns (uint256);
/// See `serializeJson`.
function serializeUintToHex(string calldata objectKey, string calldata valueKey, uint256 value)
external
returns (string memory json);
/// Returns the index of the first occurrence of a `key` in an `input` string.
/// Returns `NOT_FOUND` (i.e. `type(uint256).max`) if the `key` is not found.
/// Returns 0 in case of an empty `key`.
function indexOf(string calldata input, string calldata key) external pure returns (uint256);
/// Returns ENS namehash for provided string.
function ensNamehash(string calldata name) external pure returns (bytes32);
/// Sets `block.blobbasefee`
function blobBaseFee(uint256 newBlobBaseFee) external;
/// Sets the blobhashes in the transaction.
/// Not available on EVM versions before Cancun.
/// If used on unsupported EVM versions it will revert.
function blobhashes(bytes32[] calldata hashes) external;
/// Gets the blockhashes from the current transaction.
/// Not available on EVM versions before Cancun.
/// If used on unsupported EVM versions it will revert.
function getBlobhashes() external view returns (bytes32[] memory hashes);
/// Sets `block.prevrandao`.
/// Not available on EVM versions before Paris. Use `difficulty` instead.
/// If used on unsupported EVM versions it will revert.
function prevrandao(uint256 newPrevrandao) external;
Other Changes
- ci(github): update CI workflow by @sambacha in #526
- Revert "ci(github): update CI workflow" by @mds1 in #532
- chore: fix typo in comment by @rustfix in #542
- chore: fix bound log by @totomanov in #544
- ci: modernize workflows by @mds1 in #550
- chore: bump to v1.8.2 by @mds1 in #556
New Contributors
- @sambacha made their first contribution in #526
- @rustfix made their first contribution in #542
- @kcyeu made their first contribution in #540
- @yash-atreya made their first contribution in #553
- @meetmangukiya made their first contribution in #555
Full Changelog: v1.8.1...v1.8.2