diff --git a/Cargo.lock b/Cargo.lock index 191fb4b43609..f9bf668a1da2 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -163,7 +163,7 @@ dependencies = [ [[package]] name = "anvil" -version = "1.0.0" +version = "0.1.0" dependencies = [ "anvil-core", "anvil-rpc", @@ -666,13 +666,7 @@ checksum = "df8670b8c7b9dae1793364eafadf7239c40d669904660c5960d74cfd80b46a53" [[package]] name = "cast" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "37b2a672a2cb129a2e41c10b1224bb368f9f37a2b16b612598138befd7b37eb5" - -[[package]] -name = "cast" -version = "1.0.0" +version = "0.2.0" dependencies = [ "async-trait", "chrono", @@ -700,6 +694,12 @@ dependencies = [ "tokio", ] +[[package]] +name = "cast" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "37b2a672a2cb129a2e41c10b1224bb368f9f37a2b16b612598138befd7b37eb5" + [[package]] name = "cc" version = "1.0.79" @@ -717,7 +717,7 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "chisel" -version = "1.0.0" +version = "0.1.0" dependencies = [ "bytes", "clap 4.3.11", @@ -2169,7 +2169,7 @@ checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" [[package]] name = "forge" -version = "1.0.0" +version = "0.2.0" dependencies = [ "comfy-table", "ethers", @@ -2226,7 +2226,7 @@ dependencies = [ [[package]] name = "forge-fmt" -version = "1.0.0" +version = "0.2.0" dependencies = [ "ariadne", "ethers-core", @@ -2252,7 +2252,7 @@ dependencies = [ [[package]] name = "foundry-abi" -version = "1.0.0" +version = "0.1.0" dependencies = [ "ethers-contract", "ethers-contract-abigen", @@ -2265,7 +2265,7 @@ dependencies = [ [[package]] name = "foundry-binder" -version = "1.0.0" +version = "0.1.0" dependencies = [ "curl", "ethers-contract", @@ -2280,12 +2280,12 @@ dependencies = [ [[package]] name = "foundry-cli" -version = "1.0.0" +version = "0.2.0" dependencies = [ "anvil", "async-trait", "bytes", - "cast 1.0.0", + "cast 0.2.0", "clap 4.3.11", "clap_complete", "clap_complete_fig", @@ -2366,7 +2366,7 @@ dependencies = [ [[package]] name = "foundry-common" -version = "1.0.0" +version = "0.1.0" dependencies = [ "auto_impl", "clap 4.3.11", @@ -2398,7 +2398,7 @@ dependencies = [ [[package]] name = "foundry-config" -version = "1.0.0" +version = "0.2.0" dependencies = [ "Inflector", "dirs-next", @@ -2429,7 +2429,7 @@ dependencies = [ [[package]] name = "foundry-evm" -version = "1.0.0" +version = "0.2.0" dependencies = [ "auto_impl", "bytes", @@ -2464,7 +2464,7 @@ dependencies = [ [[package]] name = "foundry-macros" -version = "1.0.0" +version = "0.2.0" dependencies = [ "ethers-core", "foundry-macros-impl", @@ -2483,7 +2483,7 @@ dependencies = [ [[package]] name = "foundry-utils" -version = "1.0.0" +version = "0.2.0" dependencies = [ "ethers", "ethers-addressbook", @@ -6797,7 +6797,7 @@ checksum = "ed646292ffc8188ef8ea4d1e0e0150fb15a5c2e12ad9b8fc191ae7a8a7f3c4b9" [[package]] name = "ui" -version = "1.0.0" +version = "0.2.0" dependencies = [ "crossterm 0.26.1", "ethers", diff --git a/RELEASE_PROCESS.md b/RELEASE_PROCESS.md deleted file mode 100644 index 05311be5cf2d..000000000000 --- a/RELEASE_PROCESS.md +++ /dev/null @@ -1,29 +0,0 @@ -## Foundry Release Process - -## Introduction - -From 1.0 onwards, Foundry has a stable release process that is followed for each new version. This document serves as a guide and explanation for the process. - -## Step 1 - Testing and benchmarking - -Prior to creating a release commit and tagging it for release, we carefully test and benchmark the chosen commit. This is made to ensure that regressions are not made, and measure performance differences across versions. - -## Step 2 - Create release commit - -Creating a release commit involves the following steps: -- Crates are version-bumped accordingly. -- This crate bump gets committed along with the new corresponding tag, e.g `v1.0.0` or `v1.1.3`. - -## Step 3 - Create tag and dispatch release workflow - -- A tag is created for the new release commit. -- The tag is then pushed, and the release workflow will be automatically dispatched. The result of the workflow will be a new release with all the relevant files (binary, man pages and changelog). - -## Step 4 - Release sanity test - -- Once released, the new release is tested to ensure distribution channels (`foundryup`) can download and install the release. - -## Miscellaneous - -- The working branch is `master`. We do not follow a complicated `staging`/`master` separation, but rather choose to create tags at specific points on the branch history. -- The release channels are currently simple, and still based on `foundryup`. Different distribution channels might be considered down the line. \ No newline at end of file diff --git a/abi/Cargo.toml b/abi/Cargo.toml index a26c08920a2d..74cec69f0fa5 100644 --- a/abi/Cargo.toml +++ b/abi/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "foundry-abi" -version = "1.0.0" +version = "0.1.0" edition = "2021" license = "MIT OR Apache-2.0" readme = "README.md" diff --git a/anvil/Cargo.toml b/anvil/Cargo.toml index c806bc91486f..4d56f56f107b 100644 --- a/anvil/Cargo.toml +++ b/anvil/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "anvil" -version = "1.0.0" +version = "0.1.0" edition = "2021" license = "MIT OR Apache-2.0" readme = "README.md" diff --git a/binder/Cargo.toml b/binder/Cargo.toml index 91c3137da4bb..b390937cf278 100644 --- a/binder/Cargo.toml +++ b/binder/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "foundry-binder" -version = "1.0.0" +version = "0.1.0" edition = "2021" license = "MIT OR Apache-2.0" readme = "./README.md" diff --git a/cast/Cargo.toml b/cast/Cargo.toml index 2e9938a60195..cee77a664ee8 100644 --- a/cast/Cargo.toml +++ b/cast/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "cast" -version = "1.0.0" +version = "0.2.0" edition = "2021" license = "MIT OR Apache-2.0" readme = "README.md" diff --git a/chisel/Cargo.toml b/chisel/Cargo.toml index eef5845dd42d..ecdbe0d30f4a 100644 --- a/chisel/Cargo.toml +++ b/chisel/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "chisel" -version = "1.0.0" +version = "0.1.0" edition = "2021" authors = [ "clabby ", diff --git a/cli/Cargo.toml b/cli/Cargo.toml index b1ca1be1366b..7376d9da7525 100644 --- a/cli/Cargo.toml +++ b/cli/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "foundry-cli" -version = "1.0.0" +version = "0.2.0" edition = "2021" license = "MIT OR Apache-2.0" readme = "README.md" diff --git a/cli/tests/it/integration.rs b/cli/tests/it/integration.rs index 43ac35f17ec5..3bbf9eabd297 100644 --- a/cli/tests/it/integration.rs +++ b/cli/tests/it/integration.rs @@ -1,11 +1,9 @@ use foundry_cli_test_utils::{forgetest_external, util::setup_forge_remote}; forgetest_external!(solmate, "transmissions11/solmate"); -// Commenting until PRB migration. -// forgetest_external!(prb_math, "PaulRBerg/prb-math"); +forgetest_external!(prb_math, "PaulRBerg/prb-math"); forgetest_external!(prb_proxy, "PaulRBerg/prb-proxy"); -// Commenting until solady PR merged -// forgetest_external!(solady, "Vectorized/solady"); +forgetest_external!(solady, "Vectorized/solady"); forgetest_external!( geb, "reflexer-labs/geb", diff --git a/common/Cargo.toml b/common/Cargo.toml index 21be09d8f88c..4e1ecb46ed90 100644 --- a/common/Cargo.toml +++ b/common/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "foundry-common" -version = "1.0.0" +version = "0.1.0" edition = "2021" license = "MIT OR Apache-2.0" readme = "README.md" diff --git a/config/Cargo.toml b/config/Cargo.toml index 250375c196e9..6ee6c8c1fda6 100644 --- a/config/Cargo.toml +++ b/config/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "foundry-config" -version = "1.0.0" +version = "0.2.0" edition = "2021" license = "MIT OR Apache-2.0" description = "Foundry configuration" diff --git a/evm/Cargo.toml b/evm/Cargo.toml index d56cdcdefe70..ca9ce3f73675 100644 --- a/evm/Cargo.toml +++ b/evm/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "foundry-evm" -version = "1.0.0" +version = "0.2.0" edition = "2021" license = "MIT OR Apache-2.0" readme = "../README.md" diff --git a/evm/src/executor/inspector/cheatcodes/expect.rs b/evm/src/executor/inspector/cheatcodes/expect.rs index efed496eca44..fff7b8bbf476 100644 --- a/evm/src/executor/inspector/cheatcodes/expect.rs +++ b/evm/src/executor/inspector/cheatcodes/expect.rs @@ -41,16 +41,6 @@ fn expect_revert(state: &mut Cheatcodes, reason: Option, depth: u64) -> R Ok(Bytes::new()) } -fn expect_emit( - state: &mut Cheatcodes, - address: Option, - depth: u64, - checks: [bool; 4], -) -> Result { - state.expected_emits.push_back(ExpectedEmit { depth, address, checks, ..Default::default() }); - Ok(Bytes::new()) -} - #[instrument(skip_all, fields(expected_revert, status, retdata = hex::encode(&retdata)))] pub fn handle_expect_revert( is_create: bool, @@ -219,8 +209,6 @@ pub struct ExpectedCallData { pub count: u64, /// The type of call pub call_type: ExpectedCallType, - /// The depth at which this call must be checked - pub depth: u64, } #[derive(Clone, Debug, Default, PartialEq, Eq)] @@ -298,7 +286,6 @@ fn expect_call( min_gas: Option, count: u64, call_type: ExpectedCallType, - depth: u64, ) -> Result { match call_type { ExpectedCallType::Count => { @@ -310,10 +297,8 @@ fn expect_call( !expecteds.contains_key(&calldata), "Counted expected calls can only bet set once." ); - expecteds.insert( - calldata, - (ExpectedCallData { value, gas, min_gas, count, call_type, depth }, 0), - ); + expecteds + .insert(calldata, (ExpectedCallData { value, gas, min_gas, count, call_type }, 0)); Ok(Bytes::new()) } ExpectedCallType::NonCount => { @@ -331,7 +316,7 @@ fn expect_call( // If it does not exist, then create it. expecteds.insert( calldata, - (ExpectedCallData { value, gas, min_gas, count, call_type, depth }, 0), + (ExpectedCallData { value, gas, min_gas, count, call_type }, 0), ); } Ok(Bytes::new()) @@ -354,26 +339,39 @@ pub fn apply( expect_revert(state, Some(inner.0.into()), data.journaled_state.depth()) } HEVMCalls::ExpectEmit0(_) => { - expect_emit(state, None, data.journaled_state.depth(), [true, true, true, true]) + state.expected_emits.push_back(ExpectedEmit { + depth: data.journaled_state.depth(), + checks: [true, true, true, true], + ..Default::default() + }); + Ok(Bytes::new()) + } + HEVMCalls::ExpectEmit1(inner) => { + state.expected_emits.push_back(ExpectedEmit { + depth: data.journaled_state.depth(), + checks: [true, true, true, true], + address: Some(inner.0), + ..Default::default() + }); + Ok(Bytes::new()) + } + HEVMCalls::ExpectEmit2(inner) => { + state.expected_emits.push_back(ExpectedEmit { + depth: data.journaled_state.depth(), + checks: [inner.0, inner.1, inner.2, inner.3], + ..Default::default() + }); + Ok(Bytes::new()) + } + HEVMCalls::ExpectEmit3(inner) => { + state.expected_emits.push_back(ExpectedEmit { + depth: data.journaled_state.depth(), + checks: [inner.0, inner.1, inner.2, inner.3], + address: Some(inner.4), + ..Default::default() + }); + Ok(Bytes::new()) } - HEVMCalls::ExpectEmit1(inner) => expect_emit( - state, - Some(inner.0), - data.journaled_state.depth(), - [true, true, true, true], - ), - HEVMCalls::ExpectEmit2(inner) => expect_emit( - state, - None, - data.journaled_state.depth(), - [inner.0, inner.1, inner.2, inner.3], - ), - HEVMCalls::ExpectEmit3(inner) => expect_emit( - state, - Some(inner.4), - data.journaled_state.depth(), - [inner.0, inner.1, inner.2, inner.3], - ), HEVMCalls::ExpectCall0(inner) => expect_call( state, inner.0, @@ -383,7 +381,6 @@ pub fn apply( None, 1, ExpectedCallType::NonCount, - data.journaled_state.depth(), ), HEVMCalls::ExpectCall1(inner) => expect_call( state, @@ -394,7 +391,6 @@ pub fn apply( None, inner.2, ExpectedCallType::Count, - data.journaled_state.depth(), ), HEVMCalls::ExpectCall2(inner) => expect_call( state, @@ -405,7 +401,6 @@ pub fn apply( None, 1, ExpectedCallType::NonCount, - data.journaled_state.depth(), ), HEVMCalls::ExpectCall3(inner) => expect_call( state, @@ -416,7 +411,6 @@ pub fn apply( None, inner.3, ExpectedCallType::Count, - data.journaled_state.depth(), ), HEVMCalls::ExpectCall4(inner) => { let value = inner.1; @@ -433,7 +427,6 @@ pub fn apply( None, 1, ExpectedCallType::NonCount, - data.journaled_state.depth(), ) } HEVMCalls::ExpectCall5(inner) => { @@ -451,7 +444,6 @@ pub fn apply( None, inner.4, ExpectedCallType::Count, - data.journaled_state.depth(), ) } HEVMCalls::ExpectCallMinGas0(inner) => { @@ -469,7 +461,6 @@ pub fn apply( Some(inner.2 + positive_value_cost_stipend), 1, ExpectedCallType::NonCount, - data.journaled_state.depth(), ) } HEVMCalls::ExpectCallMinGas1(inner) => { @@ -487,7 +478,6 @@ pub fn apply( Some(inner.2 + positive_value_cost_stipend), inner.4, ExpectedCallType::Count, - data.journaled_state.depth(), ) } HEVMCalls::MockCall0(inner) => { diff --git a/evm/src/executor/inspector/cheatcodes/mod.rs b/evm/src/executor/inspector/cheatcodes/mod.rs index b9a144356cce..70a4b9b1ecab 100644 --- a/evm/src/executor/inspector/cheatcodes/mod.rs +++ b/evm/src/executor/inspector/cheatcodes/mod.rs @@ -594,10 +594,7 @@ where // The gas matches, if provided expected.gas.map_or(true, |gas| gas == call.gas_limit) && // The minimum gas matches, if provided - expected.min_gas.map_or(true, |min_gas| min_gas <= call.gas_limit) && - // The expected depth is smaller than the actual depth, - // which means we're in the subcalls of the call were we expect to find the matches. - expected.depth < data.journaled_state.depth() + expected.min_gas.map_or(true, |min_gas| min_gas <= call.gas_limit) { *actual_count += 1; } @@ -781,16 +778,7 @@ where // Handle expected reverts if let Some(expected_revert) = &self.expected_revert { - // Irrespective of whether a revert will be matched or not, disallow having expected - // reverts alongside expected emits or calls. - if !self.expected_calls.is_empty() || !self.expected_emits.is_empty() { - return ( - InstructionResult::Revert, - remaining_gas, - "Cannot expect a function to revert while trying to match expected calls or events.".to_string().encode().into(), - ) - } - if data.journaled_state.depth() == expected_revert.depth { + if data.journaled_state.depth() <= expected_revert.depth { let expected_revert = std::mem::take(&mut self.expected_revert).unwrap(); return match handle_expect_revert( false, @@ -841,18 +829,14 @@ where } } - // Match expected calls - for (address, calldatas) in &self.expected_calls { - // Loop over each address, and for each address, loop over each calldata it expects. - for (calldata, (expected, actual_count)) in calldatas { - // Grab the values we expect to see - let ExpectedCallData { gas, min_gas, value, count, call_type, depth } = expected; - // Only check calls in the corresponding depth, - // or if the expected depth is higher than the current depth. This is correct, as - // the expected depth can only be bigger than the current depth if - // we're either terminating the root call (the test itself), or exiting the intended - // call that contained the calls we expected to see. - if depth >= &data.journaled_state.depth() { + // If the depth is 0, then this is the root call terminating + if data.journaled_state.depth() == 0 { + // Match expected calls + for (address, calldatas) in &self.expected_calls { + // Loop over each address, and for each address, loop over each calldata it expects. + for (calldata, (expected, actual_count)) in calldatas { + // Grab the values we expect to see + let ExpectedCallData { gas, min_gas, value, count, call_type } = expected; let calldata = Bytes::from(calldata.clone()); // We must match differently depending on the type of call we expect. @@ -913,18 +897,6 @@ where } } } - } - - // If the depth is 0, then this is the root call terminating - if data.journaled_state.depth() == 0 { - // See if there's a dangling expectRevert that should've been matched. - if self.expected_revert.is_some() { - return ( - InstructionResult::Revert, - remaining_gas, - "A `vm.expectRevert`was left dangling. Make sure that calls you expect to revert are external".encode().into(), - ) - } // Check if we have any leftover expected emits // First, if any emits were found at the root call, then we its ok and we remove them. @@ -1091,7 +1063,7 @@ where // Handle expected reverts if let Some(expected_revert) = &self.expected_revert { - if data.journaled_state.depth() == expected_revert.depth { + if data.journaled_state.depth() <= expected_revert.depth { let expected_revert = std::mem::take(&mut self.expected_revert).unwrap(); return match handle_expect_revert( true, diff --git a/fmt/Cargo.toml b/fmt/Cargo.toml index 8e224cf7838b..89797e3b5dd2 100644 --- a/fmt/Cargo.toml +++ b/fmt/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "forge-fmt" -version = "1.0.0" +version = "0.2.0" edition = "2021" description = "Foundry's solidity formatting and linting support" license = "MIT OR Apache-2.0" diff --git a/forge/Cargo.toml b/forge/Cargo.toml index 19ca6c0dea49..d194a68252a3 100644 --- a/forge/Cargo.toml +++ b/forge/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "forge" -version = "1.0.0" +version = "0.2.0" edition = "2021" license = "MIT OR Apache-2.0" diff --git a/forge/tests/it/repros.rs b/forge/tests/it/repros.rs index 7af0950a8bb9..1534722d955a 100644 --- a/forge/tests/it/repros.rs +++ b/forge/tests/it/repros.rs @@ -151,10 +151,11 @@ async fn test_issue_3221() { } // -#[tokio::test(flavor = "multi_thread")] -async fn test_issue_3437() { - test_repro!("Issue3437"); -} +// 1.0 related +// #[tokio::test(flavor = "multi_thread")] +// async fn test_issue_3437() { +// test_repro!("Issue3437"); +// } // #[tokio::test(flavor = "multi_thread")] @@ -246,10 +247,11 @@ async fn test_issue_3703() { } // -#[tokio::test(flavor = "multi_thread")] -async fn test_issue_3723() { - test_repro!("Issue3723"); -} +// 1.0 related +// #[tokio::test(flavor = "multi_thread")] +// async fn test_issue_3723() { +// test_repro!("Issue3723"); +// } // #[tokio::test(flavor = "multi_thread")] @@ -270,10 +272,11 @@ async fn test_issue_4586() { } // https://github.com/foundry-rs/foundry/issues/4832 -#[tokio::test(flavor = "multi_thread")] -async fn test_issue_4832() { - test_repro!("Issue4832"); -} +// 1.0 related +// #[tokio::test(flavor = "multi_thread")] +// async fn test_issue_4832() { +// test_repro!("Issue4832"); +// } // #[tokio::test(flavor = "multi_thread")] diff --git a/macros/Cargo.toml b/macros/Cargo.toml index da29828c5b31..c16728b4c049 100644 --- a/macros/Cargo.toml +++ b/macros/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "foundry-macros" -version = "1.0.0" +version = "0.2.0" edition = "2021" license = "MIT OR Apache-2.0" readme = "README.md" diff --git a/ui/Cargo.toml b/ui/Cargo.toml index 64e03ea33ad1..3d0c3a024e33 100644 --- a/ui/Cargo.toml +++ b/ui/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "ui" -version = "1.0.0" +version = "0.2.0" edition = "2021" license = "MIT OR Apache-2.0" readme = "../README.md" diff --git a/utils/Cargo.toml b/utils/Cargo.toml index 277517dd3ab4..cbf58c040f7a 100644 --- a/utils/Cargo.toml +++ b/utils/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "foundry-utils" -version = "1.0.0" +version = "0.2.0" edition = "2021" license = "MIT OR Apache-2.0" readme = "README.md"