Skip to content

Commit

Permalink
feat: upgrade stdlib
Browse files Browse the repository at this point in the history
  • Loading branch information
roderik committed Aug 15, 2024
1 parent 6510780 commit 3a5d241
Show file tree
Hide file tree
Showing 11 changed files with 1,299 additions and 2,006 deletions.
2 changes: 1 addition & 1 deletion lib/forge-std/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "forge-std",
"version": "1.8.2",
"version": "1.9.2",
"description": "Forge Standard Library is a collection of helpful contracts and libraries for use with Forge and Foundry.",
"homepage": "https://book.getfoundry.sh/forge/forge-std",
"bugs": "https://github.com/foundry-rs/forge-std/issues",
Expand Down
5 changes: 4 additions & 1 deletion lib/forge-std/src/StdChains.sol
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ abstract contract StdChains {

stdChainsInitialized = true;

// If adding an RPC here, make sure to test the default RPC URL in `testRpcs`
// If adding an RPC here, make sure to test the default RPC URL in `test_Rpcs` in `StdChains.t.sol`
setChainWithDefaultRpcUrl("anvil", ChainData("Anvil", 31337, "http://127.0.0.1:8545"));
setChainWithDefaultRpcUrl(
"mainnet", ChainData("Mainnet", 1, "https://eth-mainnet.alchemyapi.io/v2/pwc5rmJhrdoaSEfimoKEmsvOjKSmPDrP")
Expand Down Expand Up @@ -243,6 +243,9 @@ abstract contract StdChains {
);
setChainWithDefaultRpcUrl("fraxtal", ChainData("Fraxtal", 252, "https://rpc.frax.com"));
setChainWithDefaultRpcUrl("fraxtal_testnet", ChainData("Fraxtal Testnet", 2522, "https://rpc.testnet.frax.com"));
setChainWithDefaultRpcUrl(
"berachain_bartio_testnet", ChainData("Berachain bArtio Testnet", 80084, "https://bartio.rpc.berachain.com")
);
}

// set chain info, with priority to chainAlias' rpc url in foundry.toml
Expand Down
4 changes: 2 additions & 2 deletions lib/forge-std/src/StdCheats.sol
Original file line number Diff line number Diff line change
Expand Up @@ -322,8 +322,8 @@ abstract contract StdCheatsSafe {
// Note: For some chains like Optimism these are technically predeploys (i.e. bytecode placed at a specific
// address), but the same rationale for excluding them applies so we include those too.

// These should be present on all EVM-compatible chains.
vm.assume(addr < address(0x1) || addr > address(0x9));
// These are reserved by Ethereum and may be on all EVM-compatible chains.
vm.assume(addr < address(0x1) || addr > address(0xff));

// forgefmt: disable-start
if (chainId == 10 || chainId == 420) {
Expand Down
2 changes: 1 addition & 1 deletion lib/forge-std/src/StdStorage.sol
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ library stdStorageSafe {
if (reads.length == 0) {
revert("stdStorage find(StdStorage): No storage use detected for target.");
} else {
for (uint256 i = 0; i < reads.length; i++) {
for (uint256 i = reads.length; --i >= 0;) {
bytes32 prev = vm.load(who, reads[i]);
if (prev == bytes32(0)) {
emit WARNING_UninitedSlot(who, uint256(reads[i]));
Expand Down
243 changes: 185 additions & 58 deletions lib/forge-std/src/Vm.sol

Large diffs are not rendered by default.

Loading

0 comments on commit 3a5d241

Please sign in to comment.