From aae5e286467a405e8d1b121cfaffb5b47e9f00f8 Mon Sep 17 00:00:00 2001 From: "moxey.eth" Date: Mon, 29 Apr 2024 14:49:22 +1000 Subject: [PATCH 1/3] ci: workflow --- .github/workflows/docker.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 84072e4..9b7413e 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -4,6 +4,7 @@ on: push: branches: - main + workflow_dispatch: permissions: packages: write From 6f40c89772cdfacc04bb1cbb5d012040ceddb92c Mon Sep 17 00:00:00 2001 From: "moxey.eth" Date: Mon, 29 Apr 2024 16:05:39 +1000 Subject: [PATCH 2/3] feat: submodule patches --- .gitmodules | 6 + Dockerfile.base | 34 +- patches/forge.diff | 774 --------------------------------------------- patches/foundry | 1 + patches/solc.diff | 341 -------------------- patches/solidity | 1 + 6 files changed, 22 insertions(+), 1135 deletions(-) create mode 100644 .gitmodules delete mode 100644 patches/forge.diff create mode 160000 patches/foundry delete mode 100644 patches/solc.diff create mode 160000 patches/solidity diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..6a33cfb --- /dev/null +++ b/.gitmodules @@ -0,0 +1,6 @@ +[submodule "patches/foundry"] + path = patches/foundry + url = https://github.com/wevm/foundry +[submodule "patches/solidity"] + path = patches/solidity + url = https://github.com/enitrat/solidity diff --git a/Dockerfile.base b/Dockerfile.base index 2ee13b5..b81966e 100644 --- a/Dockerfile.base +++ b/Dockerfile.base @@ -10,20 +10,17 @@ RUN apt-get update && apt-get install -y --no-install-recommends \ && \ update-ca-certificates -ENV SOLC_COMMIT=c3af02c281f54932c0adcbdf32899d0d6e988850 +COPY . /app -# Clone the Solidity repository -RUN git clone https://github.com/ethereum/solidity.git /app/solidity +WORKDIR /app -WORKDIR /app/solidity +RUN git submodule init && git submodule update --recursive -RUN git checkout $SOLC_COMMIT +WORKDIR /app/patches/solidity -COPY ./patches/solc.diff . -RUN git apply solc.diff && \ - mkdir build && \ +RUN mkdir build && \ cd build && \ - ls -al /app/solidity && \ + ls -al /app/patches/solidity && \ cmake .. -DCMAKE_BUILD_TYPE=Release && \ make solc @@ -33,26 +30,23 @@ RUN apt-get update && apt-get install -y --no-install-recommends \ ca-certificates \ git -ENV FORGE_COMMIT=5b7e4cb3c882b28f3c32ba580de27ce7381f415a +COPY . /app -RUN git clone https://github.com/foundry-rs/foundry.git /app/foundry +WORKDIR /app -WORKDIR /app/foundry +RUN git submodule init && git submodule update --recursive -RUN git checkout $FORGE_COMMIT +WORKDIR /app/patches/foundry -COPY ./patches/forge.diff . - -RUN git apply forge.diff && \ - cargo build --bin forge --release && \ +RUN cargo build --bin forge --release && \ cargo build --bin anvil --release FROM ubuntu:jammy-20240212 # Copy the compiled solc binary to a standard location -COPY --from=solc-builder /app/solidity/build/solc/solc /usr/local/bin/solc -COPY --from=foundry-builder /app/foundry/target/release/forge /usr/local/bin/forge -COPY --from=foundry-builder /app/foundry/target/release/anvil /usr/local/bin/anvil +COPY --from=solc-builder /app/patches/solidity/build/solc/solc /usr/local/bin/solc +COPY --from=foundry-builder /app/patches/foundry/target/release/forge /usr/local/bin/forge +COPY --from=foundry-builder /app/patches/foundry/target/release/anvil /usr/local/bin/anvil RUN chmod +x /usr/local/bin/solc && \ chmod +x /usr/local/bin/forge && \ diff --git a/patches/forge.diff b/patches/forge.diff deleted file mode 100644 index 9a77f68..0000000 --- a/patches/forge.diff +++ /dev/null @@ -1,774 +0,0 @@ -diff --git a/Cargo.lock b/Cargo.lock -index 67259910..c330d8d1 100644 ---- a/Cargo.lock -+++ b/Cargo.lock -@@ -2082,7 +2082,7 @@ dependencies = [ - [[package]] - name = "ethers" - version = "2.0.11" --source = "git+https://github.com/gakonst/ethers-rs?rev=f0e5b194f09c533feb10d1a686ddb9e5946ec107#f0e5b194f09c533feb10d1a686ddb9e5946ec107" -+source = "git+https://github.com/clabby/ethers-rs?branch=cl/call-type-3074#2ffcdc579fac2032c706ee81c5697aec1a731db6" - dependencies = [ - "ethers-addressbook", - "ethers-contract", -@@ -2097,7 +2097,7 @@ dependencies = [ - [[package]] - name = "ethers-addressbook" - version = "2.0.11" --source = "git+https://github.com/gakonst/ethers-rs?rev=f0e5b194f09c533feb10d1a686ddb9e5946ec107#f0e5b194f09c533feb10d1a686ddb9e5946ec107" -+source = "git+https://github.com/clabby/ethers-rs?branch=cl/call-type-3074#2ffcdc579fac2032c706ee81c5697aec1a731db6" - dependencies = [ - "ethers-core", - "once_cell", -@@ -2108,7 +2108,7 @@ dependencies = [ - [[package]] - name = "ethers-contract" - version = "2.0.11" --source = "git+https://github.com/gakonst/ethers-rs?rev=f0e5b194f09c533feb10d1a686ddb9e5946ec107#f0e5b194f09c533feb10d1a686ddb9e5946ec107" -+source = "git+https://github.com/clabby/ethers-rs?branch=cl/call-type-3074#2ffcdc579fac2032c706ee81c5697aec1a731db6" - dependencies = [ - "const-hex", - "ethers-contract-abigen", -@@ -2126,7 +2126,7 @@ dependencies = [ - [[package]] - name = "ethers-contract-abigen" - version = "2.0.11" --source = "git+https://github.com/gakonst/ethers-rs?rev=f0e5b194f09c533feb10d1a686ddb9e5946ec107#f0e5b194f09c533feb10d1a686ddb9e5946ec107" -+source = "git+https://github.com/clabby/ethers-rs?branch=cl/call-type-3074#2ffcdc579fac2032c706ee81c5697aec1a731db6" - dependencies = [ - "Inflector", - "const-hex", -@@ -2149,7 +2149,7 @@ dependencies = [ - [[package]] - name = "ethers-contract-derive" - version = "2.0.11" --source = "git+https://github.com/gakonst/ethers-rs?rev=f0e5b194f09c533feb10d1a686ddb9e5946ec107#f0e5b194f09c533feb10d1a686ddb9e5946ec107" -+source = "git+https://github.com/clabby/ethers-rs?branch=cl/call-type-3074#2ffcdc579fac2032c706ee81c5697aec1a731db6" - dependencies = [ - "Inflector", - "const-hex", -@@ -2164,7 +2164,7 @@ dependencies = [ - [[package]] - name = "ethers-core" - version = "2.0.11" --source = "git+https://github.com/gakonst/ethers-rs?rev=f0e5b194f09c533feb10d1a686ddb9e5946ec107#f0e5b194f09c533feb10d1a686ddb9e5946ec107" -+source = "git+https://github.com/clabby/ethers-rs?branch=cl/call-type-3074#2ffcdc579fac2032c706ee81c5697aec1a731db6" - dependencies = [ - "arrayvec", - "bytes", -@@ -2193,7 +2193,7 @@ dependencies = [ - [[package]] - name = "ethers-etherscan" - version = "2.0.11" --source = "git+https://github.com/gakonst/ethers-rs?rev=f0e5b194f09c533feb10d1a686ddb9e5946ec107#f0e5b194f09c533feb10d1a686ddb9e5946ec107" -+source = "git+https://github.com/clabby/ethers-rs?branch=cl/call-type-3074#2ffcdc579fac2032c706ee81c5697aec1a731db6" - dependencies = [ - "chrono", - "ethers-core", -@@ -2208,7 +2208,7 @@ dependencies = [ - [[package]] - name = "ethers-middleware" - version = "2.0.11" --source = "git+https://github.com/gakonst/ethers-rs?rev=f0e5b194f09c533feb10d1a686ddb9e5946ec107#f0e5b194f09c533feb10d1a686ddb9e5946ec107" -+source = "git+https://github.com/clabby/ethers-rs?branch=cl/call-type-3074#2ffcdc579fac2032c706ee81c5697aec1a731db6" - dependencies = [ - "async-trait", - "auto_impl", -@@ -2233,7 +2233,7 @@ dependencies = [ - [[package]] - name = "ethers-providers" - version = "2.0.11" --source = "git+https://github.com/gakonst/ethers-rs?rev=f0e5b194f09c533feb10d1a686ddb9e5946ec107#f0e5b194f09c533feb10d1a686ddb9e5946ec107" -+source = "git+https://github.com/clabby/ethers-rs?branch=cl/call-type-3074#2ffcdc579fac2032c706ee81c5697aec1a731db6" - dependencies = [ - "async-trait", - "auto_impl", -@@ -2271,7 +2271,7 @@ dependencies = [ - [[package]] - name = "ethers-signers" - version = "2.0.11" --source = "git+https://github.com/gakonst/ethers-rs?rev=f0e5b194f09c533feb10d1a686ddb9e5946ec107#f0e5b194f09c533feb10d1a686ddb9e5946ec107" -+source = "git+https://github.com/clabby/ethers-rs?branch=cl/call-type-3074#2ffcdc579fac2032c706ee81c5697aec1a731db6" - dependencies = [ - "async-trait", - "coins-bip32", -@@ -2299,7 +2299,7 @@ dependencies = [ - [[package]] - name = "ethers-solc" - version = "2.0.11" --source = "git+https://github.com/gakonst/ethers-rs?rev=f0e5b194f09c533feb10d1a686ddb9e5946ec107#f0e5b194f09c533feb10d1a686ddb9e5946ec107" -+source = "git+https://github.com/clabby/ethers-rs?branch=cl/call-type-3074#2ffcdc579fac2032c706ee81c5697aec1a731db6" - dependencies = [ - "cfg-if", - "const-hex", -@@ -5706,7 +5706,7 @@ dependencies = [ - [[package]] - name = "revm" - version = "3.5.0" --source = "git+https://github.com/bluealloy/revm?branch=reth_freeze#b00ebab8b3477f87e3d876a11b8f18d00a8f4103" -+source = "git+https://github.com/wevm/revm?branch=jxom/eip-3074#1ddd520c938bb50ddf4f8493a640f73b0924691c" - dependencies = [ - "auto_impl", - "revm-interpreter", -@@ -5718,7 +5718,7 @@ dependencies = [ - [[package]] - name = "revm-interpreter" - version = "1.3.0" --source = "git+https://github.com/bluealloy/revm?branch=reth_freeze#b00ebab8b3477f87e3d876a11b8f18d00a8f4103" -+source = "git+https://github.com/wevm/revm?branch=jxom/eip-3074#1ddd520c938bb50ddf4f8493a640f73b0924691c" - dependencies = [ - "revm-primitives", - "serde", -@@ -5727,15 +5727,13 @@ dependencies = [ - [[package]] - name = "revm-precompile" - version = "2.2.0" --source = "git+https://github.com/bluealloy/revm?branch=reth_freeze#b00ebab8b3477f87e3d876a11b8f18d00a8f4103" -+source = "git+https://github.com/wevm/revm?branch=jxom/eip-3074#1ddd520c938bb50ddf4f8493a640f73b0924691c" - dependencies = [ - "aurora-engine-modexp", - "c-kzg", -- "k256", - "once_cell", - "revm-primitives", - "ripemd", -- "secp256k1", - "sha2 0.10.8", - "substrate-bn", - ] -@@ -5743,7 +5741,7 @@ dependencies = [ - [[package]] - name = "revm-primitives" - version = "1.3.0" --source = "git+https://github.com/bluealloy/revm?branch=reth_freeze#b00ebab8b3477f87e3d876a11b8f18d00a8f4103" -+source = "git+https://github.com/wevm/revm?branch=jxom/eip-3074#1ddd520c938bb50ddf4f8493a640f73b0924691c" - dependencies = [ - "alloy-primitives", - "alloy-rlp", -@@ -5754,6 +5752,8 @@ dependencies = [ - "enumn", - "hashbrown 0.14.3", - "hex", -+ "k256", -+ "secp256k1", - "serde", - ] - -diff --git a/Cargo.toml b/Cargo.toml -index 19a26c63..38ff559a 100644 ---- a/Cargo.toml -+++ b/Cargo.toml -@@ -187,17 +187,17 @@ tower-http = "0.4" - #ethers-solc = { path = "../ethers-rs/ethers-solc" } - - [patch.crates-io] --ethers = { git = "https://github.com/gakonst/ethers-rs", rev = "f0e5b194f09c533feb10d1a686ddb9e5946ec107" } --ethers-core = { git = "https://github.com/gakonst/ethers-rs", rev = "f0e5b194f09c533feb10d1a686ddb9e5946ec107" } --ethers-contract = { git = "https://github.com/gakonst/ethers-rs", rev = "f0e5b194f09c533feb10d1a686ddb9e5946ec107" } --ethers-contract-abigen = { git = "https://github.com/gakonst/ethers-rs", rev = "f0e5b194f09c533feb10d1a686ddb9e5946ec107" } --ethers-providers = { git = "https://github.com/gakonst/ethers-rs", rev = "f0e5b194f09c533feb10d1a686ddb9e5946ec107" } --ethers-signers = { git = "https://github.com/gakonst/ethers-rs", rev = "f0e5b194f09c533feb10d1a686ddb9e5946ec107" } --ethers-middleware = { git = "https://github.com/gakonst/ethers-rs", rev = "f0e5b194f09c533feb10d1a686ddb9e5946ec107" } --ethers-solc = { git = "https://github.com/gakonst/ethers-rs", rev = "f0e5b194f09c533feb10d1a686ddb9e5946ec107" } -- --revm = { git = "https://github.com/bluealloy/revm", branch = "reth_freeze" } --revm-interpreter = { git = "https://github.com/bluealloy/revm", branch = "reth_freeze" } --revm-precompile = { git = "https://github.com/bluealloy/revm", branch = "reth_freeze" } --revm-primitives = { git = "https://github.com/bluealloy/revm", branch = "reth_freeze" } -+ethers = { git = "https://github.com/clabby/ethers-rs", branch = "cl/call-type-3074" } -+ethers-core = { git = "https://github.com/clabby/ethers-rs", branch = "cl/call-type-3074" } -+ethers-contract = { git = "https://github.com/clabby/ethers-rs", branch = "cl/call-type-3074" } -+ethers-contract-abigen = { git = "https://github.com/clabby/ethers-rs", branch = "cl/call-type-3074" } -+ethers-providers = { git = "https://github.com/clabby/ethers-rs", branch = "cl/call-type-3074" } -+ethers-signers = { git = "https://github.com/clabby/ethers-rs", branch = "cl/call-type-3074" } -+ethers-middleware = { git = "https://github.com/clabby/ethers-rs", branch = "cl/call-type-3074" } -+ethers-solc = { git = "https://github.com/clabby/ethers-rs", branch = "cl/call-type-3074" } -+ -+revm = { git = "https://github.com/wevm/revm", branch = "jxom/eip-3074" } -+revm-interpreter = { git = "https://github.com/wevm/revm", branch = "jxom/eip-3074" } -+revm-precompile = { git = "https://github.com/wevm/revm", branch = "jxom/eip-3074" } -+revm-primitives = { git = "https://github.com/wevm/revm", branch = "jxom/eip-3074" } - -diff --git a/crates/anvil/core/src/eth/transaction/mod.rs b/crates/anvil/core/src/eth/transaction/mod.rs -index 68cd9b48..b0791448 100644 ---- a/crates/anvil/core/src/eth/transaction/mod.rs -+++ b/crates/anvil/core/src/eth/transaction/mod.rs -@@ -137,7 +137,7 @@ impl EthTransactionRequest { - gas_limit: gas.unwrap_or_default(), - is_system_tx: optimism_fields.clone()?.is_system_tx, - input: data.clone().unwrap_or_default(), -- })); -+ })) - } - match ( - transaction_type, -@@ -860,9 +860,7 @@ impl Decodable for TypedTransaction { - if rlp.is_list() { - return Ok(TypedTransaction::Legacy(rlp.as_val()?)) - } -- let [first, s @ ..] = rlp.data()? else { -- return Err(DecoderError::Custom("empty slice")); -- }; -+ let [first, s @ ..] = rlp.data()? else { return Err(DecoderError::Custom("empty slice")) }; - // "advance" the header, see comments in fastrlp impl below - let s = if s.is_empty() { &rlp.as_raw()[1..] } else { s }; - -diff --git a/crates/anvil/src/eth/util.rs b/crates/anvil/src/eth/util.rs -index 4181df4e..d3c6e9d7 100644 ---- a/crates/anvil/src/eth/util.rs -+++ b/crates/anvil/src/eth/util.rs -@@ -79,6 +79,7 @@ pub fn to_precompile_id(spec_id: SpecId) -> revm::precompile::SpecId { - SpecId::MERGE | - SpecId::SHANGHAI | - SpecId::CANCUN | -+ SpecId::PRAGUE | - SpecId::BEDROCK | - SpecId::REGOLITH | - SpecId::CANYON | -diff --git a/crates/anvil/src/genesis.rs b/crates/anvil/src/genesis.rs -index 23afd5fc..43ba7030 100644 ---- a/crates/anvil/src/genesis.rs -+++ b/crates/anvil/src/genesis.rs -@@ -199,6 +199,8 @@ pub struct Config { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub cancun_block: Option, - #[serde(default, skip_serializing_if = "Option::is_none")] -+ pub prague_block: Option, -+ #[serde(default, skip_serializing_if = "Option::is_none")] - pub terminal_total_difficulty: Option, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub terminal_total_difficulty_passed: Option, -diff --git a/crates/anvil/src/hardfork.rs b/crates/anvil/src/hardfork.rs -index 42745fb8..62e20c3e 100644 ---- a/crates/anvil/src/hardfork.rs -+++ b/crates/anvil/src/hardfork.rs -@@ -22,6 +22,7 @@ pub enum Hardfork { - Paris, - Shanghai, - Cancun, -+ Prague, - #[default] - Latest, - } -@@ -48,6 +49,7 @@ impl Hardfork { - - // TODO: set block number after activation - Hardfork::Cancun => unreachable!(), -+ Hardfork::Prague => unreachable!(), - } - } - -@@ -100,6 +102,10 @@ impl Hardfork { - // TODO: set fork hash once known - ForkId { hash: ForkHash([0xc1, 0xfd, 0xf1, 0x81]), next: 0 } - } -+ Hardfork::Prague => { -+ // TODO: set fork hash once known -+ ForkId { hash: ForkHash([0xc1, 0xfd, 0xf1, 0x81]), next: 0 } -+ } - } - } - } -@@ -127,6 +133,7 @@ impl FromStr for Hardfork { - "paris" | "merge" | "15" => Hardfork::Paris, - "shanghai" | "16" => Hardfork::Shanghai, - "cancun" | "17" => Hardfork::Cancun, -+ "prague" | "18" => Hardfork::Prague, - "latest" => Hardfork::Latest, - _ => return Err(format!("Unknown hardfork {s}")), - }; -@@ -156,6 +163,7 @@ impl From for SpecId { - - // TODO: switch to latest after activation - Hardfork::Cancun => SpecId::CANCUN, -+ Hardfork::Prague => SpecId::PRAGUE, - } - } - } -diff --git a/crates/cast/bin/cmd/create2.rs b/crates/cast/bin/cmd/create2.rs -index 661ea3cb..44f9bef1 100644 ---- a/crates/cast/bin/cmd/create2.rs -+++ b/crates/cast/bin/cmd/create2.rs -@@ -196,7 +196,7 @@ impl Create2Args { - loop { - // Stop if a result was found in another thread. - if found.load(Ordering::Relaxed) { -- break None; -+ break None - } - - // Calculate the `CREATE2` address. -@@ -211,7 +211,7 @@ impl Create2Args { - if regex.matches(s).into_iter().count() == regex_len { - // Notify other threads that we found a result. - found.store(true, Ordering::Relaxed); -- break Some((salt.0, addr)); -+ break Some((salt.0, addr)) - } - - // Increment the salt for the next iteration. -diff --git a/crates/cast/bin/cmd/storage.rs b/crates/cast/bin/cmd/storage.rs -index 676d9e4d..94efe374 100644 ---- a/crates/cast/bin/cmd/storage.rs -+++ b/crates/cast/bin/cmd/storage.rs -@@ -217,7 +217,7 @@ async fn fetch_storage_slots( - fn print_storage(layout: StorageLayout, values: Vec, pretty: bool) -> Result<()> { - if !pretty { - println!("{}", serde_json::to_string_pretty(&serde_json::to_value(layout)?)?); -- return Ok(()); -+ return Ok(()) - } - - let mut table = Table::new(); -diff --git a/crates/cast/src/rlp_converter.rs b/crates/cast/src/rlp_converter.rs -index 3a520844..c67c99cf 100644 ---- a/crates/cast/src/rlp_converter.rs -+++ b/crates/cast/src/rlp_converter.rs -@@ -24,7 +24,7 @@ impl Decodable for Item { - fn decode(buf: &mut &[u8]) -> alloy_rlp::Result { - let h = Header::decode(buf)?; - if buf.len() < h.payload_length { -- return Err(alloy_rlp::Error::InputTooShort); -+ return Err(alloy_rlp::Error::InputTooShort) - } - let mut d = &buf[..h.payload_length]; - let r = if h.list { -diff --git a/crates/cheatcodes/spec/src/vm.rs b/crates/cheatcodes/spec/src/vm.rs -index a9421d08..676640a2 100644 ---- a/crates/cheatcodes/spec/src/vm.rs -+++ b/crates/cheatcodes/spec/src/vm.rs -@@ -47,6 +47,8 @@ interface Vm { - CallCode, - /// The account was called via staticcall. - StaticCall, -+ /// The account was called via authcall. -+ AuthCall, - /// The account was created. - Create, - /// The account was selfdestructed. -diff --git a/crates/cheatcodes/src/inspector.rs b/crates/cheatcodes/src/inspector.rs -index 2eef1975..9151c1d8 100644 ---- a/crates/cheatcodes/src/inspector.rs -+++ b/crates/cheatcodes/src/inspector.rs -@@ -826,6 +826,7 @@ impl Inspector for Cheatcodes { - CallScheme::CallCode => crate::Vm::AccountAccessKind::CallCode, - CallScheme::DelegateCall => crate::Vm::AccountAccessKind::DelegateCall, - CallScheme::StaticCall => crate::Vm::AccountAccessKind::StaticCall, -+ CallScheme::AuthCall => crate::Vm::AccountAccessKind::AuthCall, - }; - // Record this call by pushing it to a new pending vector; all subsequent calls at - // that depth will be pushed to the same vector. When the call ends, the -diff --git a/crates/cheatcodes/src/string.rs b/crates/cheatcodes/src/string.rs -index f5535059..d40e1d8d 100644 ---- a/crates/cheatcodes/src/string.rs -+++ b/crates/cheatcodes/src/string.rs -@@ -138,7 +138,7 @@ fn parse_value_fallback(s: &str, ty: &DynSolType) -> Option false, - _ => return None, - }; -- return Some(Ok(DynSolValue::Bool(b))); -+ return Some(Ok(DynSolValue::Bool(b))) - } - DynSolType::Int(_) | - DynSolType::Uint(_) | -diff --git a/crates/cheatcodes/src/test/expect.rs b/crates/cheatcodes/src/test/expect.rs -index bdecef14..64266ae3 100644 ---- a/crates/cheatcodes/src/test/expect.rs -+++ b/crates/cheatcodes/src/test/expect.rs -@@ -457,7 +457,7 @@ pub(crate) fn handle_expect_revert( - - // If None, accept any revert - let Some(expected_revert) = expected_revert else { -- return Ok(success_return()); -+ return Ok(success_return()) - }; - - if !expected_revert.is_empty() && retdata.is_empty() { -diff --git a/crates/common/src/fmt/dynamic.rs b/crates/common/src/fmt/dynamic.rs -index 2e30f2f7..d8a8d207 100644 ---- a/crates/common/src/fmt/dynamic.rs -+++ b/crates/common/src/fmt/dynamic.rs -@@ -41,7 +41,7 @@ impl DynValueFormatter { - DynSolValue::Bool(inner) => write!(f, "{inner}"), - DynSolValue::CustomStruct { name, prop_names, tuple } => { - if self.raw { -- return self.tuple(tuple, f); -+ return self.tuple(tuple, f) - } - - f.write_str(name)?; -diff --git a/crates/common/src/fmt/mod.rs b/crates/common/src/fmt/mod.rs -index fbe1670f..ea03a982 100644 ---- a/crates/common/src/fmt/mod.rs -+++ b/crates/common/src/fmt/mod.rs -@@ -68,7 +68,7 @@ pub fn format_uint_exp(num: U256) -> String { - pub fn format_int_exp(num: I256) -> String { - let (sign, abs) = num.into_sign_and_abs(); - if abs < U256::from(10_000) { -- return format!("{sign}{abs}"); -+ return format!("{sign}{abs}") - } - - let exp = to_exp_notation(abs, 4, true, sign); -diff --git a/crates/common/src/provider.rs b/crates/common/src/provider.rs -index 730260d9..bea5e18b 100644 ---- a/crates/common/src/provider.rs -+++ b/crates/common/src/provider.rs -@@ -302,7 +302,7 @@ fn resolve_path(path: &Path) -> Result { - fn resolve_path(path: &Path) -> Result { - if let Some(s) = path.to_str() { - if s.starts_with(r"\\.\pipe\") { -- return Ok(path.to_path_buf()); -+ return Ok(path.to_path_buf()) - } - } - Err(()) -diff --git a/crates/config/src/lib.rs b/crates/config/src/lib.rs -index 51757753..31b1bd42 100644 ---- a/crates/config/src/lib.rs -+++ b/crates/config/src/lib.rs -@@ -369,6 +369,9 @@ pub struct Config { - /// Should be removed once EvmVersion Cancun is supported by solc - pub cancun: bool, - -+ /// Temporary config to enable [SpecId::PRAGUE] -+ pub prague: bool, -+ - /// The root path where the config detection started from, `Config::with_root` - #[doc(hidden)] - // We're skipping serialization here, so it won't be included in the [`Config::to_string()`] -@@ -694,7 +697,9 @@ impl Config { - /// Returns the [SpecId] derived from the configured [EvmVersion] - #[inline] - pub fn evm_spec_id(&self) -> SpecId { -- if self.cancun { -+ if self.prague { -+ return SpecId::PRAGUE -+ } else if self.cancun { - return SpecId::CANCUN - } - evm_spec_id(&self.evm_version) -@@ -1752,6 +1757,7 @@ impl Default for Config { - profile: Self::DEFAULT_PROFILE, - fs_permissions: FsPermissions::new([PathPermission::read("out")]), - cancun: false, -+ prague: false, - __root: Default::default(), - src: "src".into(), - test: "test".into(), -diff --git a/crates/debugger/src/tui.rs b/crates/debugger/src/tui.rs -index 7cd2b67e..9d9fbfca 100644 ---- a/crates/debugger/src/tui.rs -+++ b/crates/debugger/src/tui.rs -@@ -677,6 +677,7 @@ Line::from(Span::styled("[t]: stack labels | [m]: memory decoding | [shift + j/k - CallKind::StaticCall => "Contract staticcall", - CallKind::CallCode => "Contract callcode", - CallKind::DelegateCall => "Contract delegatecall", -+ CallKind::AuthCall => "Contract authcall", - }) - .borders(Borders::ALL); - -@@ -1257,7 +1258,8 @@ Line::from(Span::styled("[t]: stack labels | [m]: memory decoding | [shift + j/k - (i == (offset + size - 1) / 32 && - j <= (offset + size - 1) % 32) - { -- // [offset, offset + size] is the memory region to be colored. -+ // [offset, offset + size] is the memory region to be -+ // colored. - // If a byte at row i and column j in the memory panel - // falls in this region, set the color. - Style::default().fg(color) -diff --git a/crates/doc/src/builder.rs b/crates/doc/src/builder.rs -index 692e69b8..1826f351 100644 ---- a/crates/doc/src/builder.rs -+++ b/crates/doc/src/builder.rs -@@ -133,13 +133,13 @@ impl DocBuilder { - Err(err) => { - if from_library { - // Ignore failures for library files -- return Ok(Vec::new()); -+ return Ok(Vec::new()) - } else { - return Err(eyre::eyre!( - "Failed to parse Solidity code for {}\nDebug info: {:?}", - path.display(), - err -- )); -+ )) - } - } - }; -diff --git a/crates/doc/src/preprocessor/contract_inheritance.rs b/crates/doc/src/preprocessor/contract_inheritance.rs -index 7b4b28e1..b4972ac9 100644 ---- a/crates/doc/src/preprocessor/contract_inheritance.rs -+++ b/crates/doc/src/preprocessor/contract_inheritance.rs -@@ -54,7 +54,7 @@ impl ContractInheritance { - fn try_link_base(&self, base: &str, documents: &Vec) -> Option { - for candidate in documents { - if candidate.from_library && !self.include_libraries { -- continue; -+ continue - } - if let DocumentContent::Single(ref item) = candidate.content { - if let ParseSource::Contract(ref contract) = item.source { -diff --git a/crates/doc/src/preprocessor/git_source.rs b/crates/doc/src/preprocessor/git_source.rs -index eaa53e62..a72764c6 100644 ---- a/crates/doc/src/preprocessor/git_source.rs -+++ b/crates/doc/src/preprocessor/git_source.rs -@@ -29,7 +29,7 @@ impl Preprocessor for GitSource { - let commit = self.commit.clone().unwrap_or("master".to_owned()); - for document in documents.iter() { - if document.from_library { -- continue; -+ continue - } - let git_url = format!( - "{repo}/blob/{commit}/{}", -diff --git a/crates/evm/core/src/decode.rs b/crates/evm/core/src/decode.rs -index 6812cfd4..3d09bb51 100644 ---- a/crates/evm/core/src/decode.rs -+++ b/crates/evm/core/src/decode.rs -@@ -57,7 +57,7 @@ pub fn maybe_decode_revert( - if err.len() < SELECTOR_LEN { - if let Some(status) = status { - if !status.is_ok() { -- return Some(format!("EvmError: {status:?}")); -+ return Some(format!("EvmError: {status:?}")) - } - } - return if err.is_empty() { -@@ -69,12 +69,12 @@ pub fn maybe_decode_revert( - - if err == crate::constants::MAGIC_SKIP { - // Also used in forge fuzz runner -- return Some("SKIPPED".to_string()); -+ return Some("SKIPPED".to_string()) - } - - // Solidity's `Error(string)` or `Panic(uint256)` - if let Ok(e) = alloy_sol_types::GenericContractError::abi_decode(err, false) { -- return Some(e.to_string()); -+ return Some(e.to_string()) - } - - let (selector, data) = err.split_at(SELECTOR_LEN); -@@ -84,17 +84,17 @@ pub fn maybe_decode_revert( - // `CheatcodeError(string)` - Vm::CheatcodeError::SELECTOR => { - let e = Vm::CheatcodeError::abi_decode_raw(data, false).ok()?; -- return Some(e.message); -+ return Some(e.message) - } - // `expectRevert(bytes)` - Vm::expectRevert_2Call::SELECTOR => { - let e = Vm::expectRevert_2Call::abi_decode_raw(data, false).ok()?; -- return maybe_decode_revert(&e.revertData[..], maybe_abi, status); -+ return maybe_decode_revert(&e.revertData[..], maybe_abi, status) - } - // `expectRevert(bytes4)` - Vm::expectRevert_1Call::SELECTOR => { - let e = Vm::expectRevert_1Call::abi_decode_raw(data, false).ok()?; -- return maybe_decode_revert(&e.revertData[..], maybe_abi, status); -+ return maybe_decode_revert(&e.revertData[..], maybe_abi, status) - } - _ => {} - } -@@ -108,19 +108,19 @@ pub fn maybe_decode_revert( - "{}({})", - abi_error.name, - decoded.iter().map(foundry_common::fmt::format_token).format(", ") -- )); -+ )) - } - } - } - - // ABI-encoded `string` - if let Ok(s) = String::abi_decode(err, false) { -- return Some(s); -+ return Some(s) - } - - // UTF-8-encoded string - if let Ok(s) = std::str::from_utf8(err) { -- return Some(s.to_string()); -+ return Some(s.to_string()) - } - - // Generic custom error -diff --git a/crates/evm/core/src/opts.rs b/crates/evm/core/src/opts.rs -index 1ccac43d..dd99a391 100644 ---- a/crates/evm/core/src/opts.rs -+++ b/crates/evm/core/src/opts.rs -@@ -182,14 +182,14 @@ impl EvmOpts { - if let Some(ref url) = self.fork_url { - if url.contains("mainnet") { - trace!(?url, "auto detected mainnet chain"); -- return Some(Chain::mainnet()); -+ return Some(Chain::mainnet()) - } - trace!(?url, "retrieving chain via eth_chainId"); - let provider = Provider::try_from(url.as_str()) - .unwrap_or_else(|_| panic!("Failed to establish provider to {url}")); - - if let Ok(id) = RuntimeOrHandle::new().block_on(provider.get_chainid()) { -- return Some(Chain::from(id.as_u64())); -+ return Some(Chain::from(id.as_u64())) - } - } - -diff --git a/crates/evm/core/src/utils.rs b/crates/evm/core/src/utils.rs -index 8edaa4e2..879d0977 100644 ---- a/crates/evm/core/src/utils.rs -+++ b/crates/evm/core/src/utils.rs -@@ -22,6 +22,7 @@ pub enum CallKind { - StaticCall, - CallCode, - DelegateCall, -+ AuthCall, - Create, - Create2, - } -@@ -33,6 +34,7 @@ impl From for CallKind { - CallScheme::StaticCall => CallKind::StaticCall, - CallScheme::CallCode => CallKind::CallCode, - CallScheme::DelegateCall => CallKind::DelegateCall, -+ CallScheme::AuthCall => CallKind::AuthCall, - } - } - } -@@ -49,9 +51,11 @@ impl From for CallKind { - impl From for ActionType { - fn from(kind: CallKind) -> Self { - match kind { -- CallKind::Call | CallKind::StaticCall | CallKind::DelegateCall | CallKind::CallCode => { -- ActionType::Call -- } -+ CallKind::Call | -+ CallKind::StaticCall | -+ CallKind::DelegateCall | -+ CallKind::CallCode | -+ CallKind::AuthCall => ActionType::Call, - CallKind::Create => ActionType::Create, - CallKind::Create2 => ActionType::Create, - } -@@ -65,6 +69,7 @@ impl From for CallType { - CallKind::StaticCall => CallType::StaticCall, - CallKind::CallCode => CallType::CallCode, - CallKind::DelegateCall => CallType::DelegateCall, -+ CallKind::AuthCall => CallType::AuthCall, - CallKind::Create => CallType::None, - CallKind::Create2 => CallType::None, - } -@@ -129,6 +134,7 @@ pub fn halt_to_instruction_result(halt: Halt) -> InstructionResult { - Halt::CreateInitcodeSizeLimit => InstructionResult::CreateInitcodeSizeLimit, - Halt::OverflowPayment => InstructionResult::OverflowPayment, - Halt::StateChangeDuringStaticCall => InstructionResult::StateChangeDuringStaticCall, -+ Halt::ActiveAccountUnsetAuthCall => InstructionResult::ActiveAccountUnsetAuthCall, - Halt::CallNotAllowedInsideStatic => InstructionResult::CallNotAllowedInsideStatic, - Halt::OutOfFund => InstructionResult::OutOfFund, - Halt::CallTooDeep => InstructionResult::CallTooDeep, -diff --git a/crates/evm/traces/src/decoder/mod.rs b/crates/evm/traces/src/decoder/mod.rs -index 2866d831..ece2f13b 100644 ---- a/crates/evm/traces/src/decoder/mod.rs -+++ b/crates/evm/traces/src/decoder/mod.rs -@@ -460,7 +460,7 @@ impl CallTraceDecoder { - fn apply_label(&self, value: &DynSolValue) -> String { - if let DynSolValue::Address(addr) = value { - if let Some(label) = self.labels.get(addr) { -- return format!("{label}: [{addr}]"); -+ return format!("{label}: [{addr}]") - } - } - format_token(value) -diff --git a/crates/evm/traces/src/lib.rs b/crates/evm/traces/src/lib.rs -index 3d88ee23..4dd1e5ae 100644 ---- a/crates/evm/traces/src/lib.rs -+++ b/crates/evm/traces/src/lib.rs -@@ -535,6 +535,7 @@ impl fmt::Display for CallTrace { - CallKind::StaticCall => " [staticcall]", - CallKind::CallCode => " [callcode]", - CallKind::DelegateCall => " [delegatecall]", -+ CallKind::AuthCall => " [authcall]", - CallKind::Create | CallKind::Create2 => unreachable!(), - }; - -diff --git a/crates/evm/traces/src/node.rs b/crates/evm/traces/src/node.rs -index e68840b6..b7539027 100644 ---- a/crates/evm/traces/src/node.rs -+++ b/crates/evm/traces/src/node.rs -@@ -37,12 +37,14 @@ impl CallTraceNode { - /// Returns the `Res` for a parity trace - pub fn parity_result(&self) -> Res { - match self.kind() { -- CallKind::Call | CallKind::StaticCall | CallKind::CallCode | CallKind::DelegateCall => { -- Res::Call(CallResult { -- gas_used: self.trace.gas_cost.into(), -- output: self.trace.output.to_raw().into(), -- }) -- } -+ CallKind::Call | -+ CallKind::StaticCall | -+ CallKind::CallCode | -+ CallKind::DelegateCall | -+ CallKind::AuthCall => Res::Call(CallResult { -+ gas_used: self.trace.gas_cost.into(), -+ output: self.trace.output.to_raw().into(), -+ }), - CallKind::Create | CallKind::Create2 => Res::Create(CreateResult { - gas_used: self.trace.gas_cost.into(), - code: self.trace.output.to_raw().into(), -@@ -62,16 +64,18 @@ impl CallTraceNode { - }) - } - match self.kind() { -- CallKind::Call | CallKind::StaticCall | CallKind::CallCode | CallKind::DelegateCall => { -- Action::Call(Call { -- from: self.trace.caller.to_ethers(), -- to: self.trace.address.to_ethers(), -- value: self.trace.value.to_ethers(), -- gas: self.trace.gas_cost.into(), -- input: self.trace.data.as_bytes().to_vec().into(), -- call_type: self.kind().into(), -- }) -- } -+ CallKind::Call | -+ CallKind::StaticCall | -+ CallKind::CallCode | -+ CallKind::DelegateCall | -+ CallKind::AuthCall => Action::Call(Call { -+ from: self.trace.caller.to_ethers(), -+ to: self.trace.address.to_ethers(), -+ value: self.trace.value.to_ethers(), -+ gas: self.trace.gas_cost.into(), -+ input: self.trace.data.as_bytes().to_vec().into(), -+ call_type: self.kind().into(), -+ }), - CallKind::Create | CallKind::Create2 => Action::Create(Create { - from: self.trace.caller.to_ethers(), - value: self.trace.value.to_ethers(), -diff --git a/crates/forge/bin/cmd/script/multi.rs b/crates/forge/bin/cmd/script/multi.rs -index 7fa4709a..2eb5e2b4 100644 ---- a/crates/forge/bin/cmd/script/multi.rs -+++ b/crates/forge/bin/cmd/script/multi.rs -@@ -144,7 +144,7 @@ impl ScriptArgs { - join_all(futs).await.into_iter().filter(|res| res.is_err()).collect::>(); - - if !errors.is_empty() { -- return Err(eyre::eyre!("{errors:?}")); -+ return Err(eyre::eyre!("{errors:?}")) - } - } - -diff --git a/crates/forge/tests/cli/config.rs b/crates/forge/tests/cli/config.rs -index 27001b73..30fa8f4d 100644 ---- a/crates/forge/tests/cli/config.rs -+++ b/crates/forge/tests/cli/config.rs -@@ -112,6 +112,7 @@ forgetest!(can_extract_config_values, |prj, cmd| { - doc: Default::default(), - fs_permissions: Default::default(), - cancun: true, -+ prague: true, - __non_exhaustive: (), - __warnings: vec![], - }; diff --git a/patches/foundry b/patches/foundry new file mode 160000 index 0000000..18e25da --- /dev/null +++ b/patches/foundry @@ -0,0 +1 @@ +Subproject commit 18e25da78e5add65eab165e598f607c92a283c01 diff --git a/patches/solc.diff b/patches/solc.diff deleted file mode 100644 index 4e1bbbe..0000000 --- a/patches/solc.diff +++ /dev/null @@ -1,341 +0,0 @@ -diff --git a/libevmasm/Instruction.cpp b/libevmasm/Instruction.cpp -index 174d12b5e..cfd0d85a8 100644 ---- a/libevmasm/Instruction.cpp -+++ b/libevmasm/Instruction.cpp -@@ -167,6 +167,8 @@ std::map const solidity::evmasm::c_instructions = - { "CALL", Instruction::CALL }, - { "CALLCODE", Instruction::CALLCODE }, - { "STATICCALL", Instruction::STATICCALL }, -+ { "AUTH", Instruction::AUTH }, -+ { "AUTHCALL", Instruction::AUTHCALL }, - { "RETURN", Instruction::RETURN }, - { "DELEGATECALL", Instruction::DELEGATECALL }, - { "CREATE2", Instruction::CREATE2 }, -@@ -318,6 +320,8 @@ static std::map const c_instructionInfo = - { Instruction::RETURN, { "RETURN", 0, 2, 0, true, Tier::Zero } }, - { Instruction::DELEGATECALL, { "DELEGATECALL", 0, 6, 1, true, Tier::Special } }, - { Instruction::STATICCALL, { "STATICCALL", 0, 6, 1, true, Tier::Special } }, -+ { Instruction::AUTH, { "AUTH", 0, 3, 1, true, Tier::Special } }, -+ { Instruction::AUTHCALL, { "AUTHCALL", 0, 7, 1, true, Tier::Special } }, - { Instruction::CREATE2, { "CREATE2", 0, 4, 1, true, Tier::Special } }, - { Instruction::REVERT, { "REVERT", 0, 2, 0, true, Tier::Zero } }, - { Instruction::INVALID, { "INVALID", 0, 0, 0, true, Tier::Zero } }, -diff --git a/libevmasm/Instruction.h b/libevmasm/Instruction.h -index 2fddb11d8..b80a8b9d7 100644 ---- a/libevmasm/Instruction.h -+++ b/libevmasm/Instruction.h -@@ -183,6 +183,8 @@ enum class Instruction: uint8_t - RETURN, ///< halt execution returning output data - DELEGATECALL, ///< like CALLCODE but keeps caller's value and sender - CREATE2 = 0xf5, ///< create new account with associated code at address `sha3(0xff + sender + salt + init code) % 2**160` -+ AUTH = 0xf6, ///< authenticate an authorized account for the `AUTHCALL` instruction -+ AUTHCALL = 0xf7, ///< message-call into an account with authentication for acting as an EOA - STATICCALL = 0xfa, ///< like CALL but disallow state modifications - - REVERT = 0xfd, ///< halt execution, revert state and return output data -diff --git a/libevmasm/SemanticInformation.cpp b/libevmasm/SemanticInformation.cpp -index 1971d9d45..79ab7b29d 100644 ---- a/libevmasm/SemanticInformation.cpp -+++ b/libevmasm/SemanticInformation.cpp -@@ -104,10 +104,22 @@ std::vector SemanticInformation::readWriteOperat - op.lengthParameter = 2; - return {op}; - } -+ case Instruction::AUTH: -+ { -+ assertThrow(memory(_instruction) == Effect::Read, OptimizerException, ""); -+ assertThrow(storage(_instruction) == Effect::None, OptimizerException, ""); -+ Operation op; -+ op.effect = memory(_instruction); -+ op.location = Location::Memory; -+ op.startParameter = 1; -+ op.lengthParameter = 2; -+ return {op}; -+ } - case Instruction::STATICCALL: - case Instruction::CALL: - case Instruction::CALLCODE: - case Instruction::DELEGATECALL: -+ case Instruction::AUTHCALL: - { - size_t paramCount = static_cast(instructionInfo(_instruction, langutil::EVMVersion()).args); - std::vector operations{ -diff --git a/libsolidity/analysis/TypeChecker.cpp b/libsolidity/analysis/TypeChecker.cpp -index 5c28d3cd2..13303a9db 100644 ---- a/libsolidity/analysis/TypeChecker.cpp -+++ b/libsolidity/analysis/TypeChecker.cpp -@@ -1453,7 +1453,8 @@ void TypeChecker::endVisit(ExpressionStatement const& _statement) - kind == FunctionType::Kind::BareCall || - kind == FunctionType::Kind::BareCallCode || - kind == FunctionType::Kind::BareDelegateCall || -- kind == FunctionType::Kind::BareStaticCall -+ kind == FunctionType::Kind::BareStaticCall || -+ kind == FunctionType::Kind::BareAuthCall - ) - m_errorReporter.warning(9302_error, _statement.location(), "Return value of low-level calls not used."); - else if (kind == FunctionType::Kind::Send) -@@ -2543,7 +2544,8 @@ void TypeChecker::typeCheckFunctionGeneralChecks( - _functionType->kind() == FunctionType::Kind::BareCall || - _functionType->kind() == FunctionType::Kind::BareCallCode || - _functionType->kind() == FunctionType::Kind::BareDelegateCall || -- _functionType->kind() == FunctionType::Kind::BareStaticCall -+ _functionType->kind() == FunctionType::Kind::BareStaticCall || -+ _functionType->kind() == FunctionType::Kind::BareAuthCall - ) - { - solAssert(!isVariadic, ""); -@@ -2672,7 +2674,8 @@ void TypeChecker::typeCheckFunctionGeneralChecks( - _functionType->kind() == FunctionType::Kind::BareCall || - _functionType->kind() == FunctionType::Kind::BareCallCode || - _functionType->kind() == FunctionType::Kind::BareDelegateCall || -- _functionType->kind() == FunctionType::Kind::BareStaticCall -+ _functionType->kind() == FunctionType::Kind::BareStaticCall || -+ _functionType->kind() == FunctionType::Kind::BareAuthCall - ) - return { - 8051_error, -@@ -2967,7 +2970,8 @@ bool TypeChecker::visit(FunctionCallOptions const& _functionCallOptions) - kind != FunctionType::Kind::BareCall && - kind != FunctionType::Kind::BareCallCode && - kind != FunctionType::Kind::BareDelegateCall && -- kind != FunctionType::Kind::BareStaticCall -+ kind != FunctionType::Kind::BareStaticCall && -+ kind != FunctionType::Kind::BareAuthCall - ) - { - m_errorReporter.fatalTypeError( -diff --git a/libsolidity/ast/Types.cpp b/libsolidity/ast/Types.cpp -index 7b3e42143..84dc33166 100644 ---- a/libsolidity/ast/Types.cpp -+++ b/libsolidity/ast/Types.cpp -@@ -558,7 +558,8 @@ MemberList::MemberMap AddressType::nativeMembers(ASTNode const*) const - {"call", TypeProvider::function(strings{"bytes memory"}, strings{"bool", "bytes memory"}, FunctionType::Kind::BareCall, StateMutability::Payable)}, - {"callcode", TypeProvider::function(strings{"bytes memory"}, strings{"bool", "bytes memory"}, FunctionType::Kind::BareCallCode, StateMutability::Payable)}, - {"delegatecall", TypeProvider::function(strings{"bytes memory"}, strings{"bool", "bytes memory"}, FunctionType::Kind::BareDelegateCall, StateMutability::NonPayable)}, -- {"staticcall", TypeProvider::function(strings{"bytes memory"}, strings{"bool", "bytes memory"}, FunctionType::Kind::BareStaticCall, StateMutability::View)} -+ {"staticcall", TypeProvider::function(strings{"bytes memory"}, strings{"bool", "bytes memory"}, FunctionType::Kind::BareStaticCall, StateMutability::View)}, -+ {"authcall", TypeProvider::function(strings{"bytes memory"}, strings{"bool", "bytes memory"}, FunctionType::Kind::BareAuthCall, StateMutability::Payable)} - }; - if (m_stateMutability == StateMutability::Payable) - { -@@ -3006,7 +3007,8 @@ TypePointers FunctionType::returnParameterTypesWithoutDynamicTypes() const - m_kind == Kind::BareCall || - m_kind == Kind::BareCallCode || - m_kind == Kind::BareDelegateCall || -- m_kind == Kind::BareStaticCall -+ m_kind == Kind::BareStaticCall || -+ m_kind == Kind::BareAuthCall - ) - for (auto& param: returnParameterTypes) - { -@@ -3043,6 +3045,7 @@ std::string FunctionType::richIdentifier() const - case Kind::BareCallCode: id += "barecallcode"; break; - case Kind::BareDelegateCall: id += "baredelegatecall"; break; - case Kind::BareStaticCall: id += "barestaticcall"; break; -+ case Kind::BareAuthCall: id += "bareauthcall"; break; - case Kind::Creation: id += "creation"; break; - case Kind::Send: id += "send"; break; - case Kind::Transfer: id += "transfer"; break; -@@ -3285,6 +3288,7 @@ std::vector> FunctionType::makeStackItems() - case Kind::BareCallCode: - case Kind::BareDelegateCall: - case Kind::BareStaticCall: -+ case Kind::BareAuthCall: - case Kind::Transfer: - case Kind::Send: - slots = {std::make_tuple("address", TypeProvider::address())}; -@@ -3380,6 +3384,7 @@ MemberList::MemberMap FunctionType::nativeMembers(ASTNode const* _scope) const - case Kind::BareCallCode: - case Kind::BareDelegateCall: - case Kind::BareStaticCall: -+ case Kind::BareAuthCall: - { - MemberList::MemberMap members; - if (m_kind == Kind::External) -@@ -3587,6 +3592,7 @@ bool FunctionType::isBareCall() const - case Kind::BareCallCode: - case Kind::BareDelegateCall: - case Kind::BareStaticCall: -+ case Kind::BareAuthCall: - case Kind::ECRecover: - case Kind::SHA256: - case Kind::RIPEMD160: -@@ -3780,6 +3786,7 @@ bool FunctionType::padArguments() const - case Kind::BareCallCode: - case Kind::BareDelegateCall: - case Kind::BareStaticCall: -+ case Kind::BareAuthCall: - case Kind::SHA256: - case Kind::RIPEMD160: - case Kind::KECCAK256: -diff --git a/libsolidity/ast/Types.h b/libsolidity/ast/Types.h -index fd1b6a7d3..1334aa26a 100644 ---- a/libsolidity/ast/Types.h -+++ b/libsolidity/ast/Types.h -@@ -1254,6 +1254,7 @@ public: - BareCallCode, ///< CALLCODE without function hash - BareDelegateCall, ///< DELEGATECALL without function hash - BareStaticCall, ///< STATICCALL without function hash -+ BareAuthCall, ///< AUTHCALL without function hash - Creation, ///< external call using CREATE - Send, ///< CALL, but without data and gas - Transfer, ///< CALL, but without data and throws on error -@@ -1494,6 +1495,7 @@ public: - case FunctionType::Kind::BareCallCode: - case FunctionType::Kind::BareDelegateCall: - case FunctionType::Kind::BareStaticCall: -+ case FunctionType::Kind::BareAuthCall: - return true; - default: - return false; -diff --git a/libsolidity/codegen/ExpressionCompiler.cpp b/libsolidity/codegen/ExpressionCompiler.cpp -index 517f49c35..fd4e2691e 100644 ---- a/libsolidity/codegen/ExpressionCompiler.cpp -+++ b/libsolidity/codegen/ExpressionCompiler.cpp -@@ -727,6 +727,7 @@ bool ExpressionCompiler::visit(FunctionCall const& _functionCall) - case FunctionType::Kind::BareCall: - case FunctionType::Kind::BareDelegateCall: - case FunctionType::Kind::BareStaticCall: -+ case FunctionType::Kind::BareAuthCall: - solAssert(!_functionCall.annotation().tryCall, ""); - [[fallthrough]]; - case FunctionType::Kind::External: -@@ -1623,6 +1624,7 @@ bool ExpressionCompiler::visit(MemberAccess const& _memberAccess) - case FunctionType::Kind::BareCallCode: - case FunctionType::Kind::BareDelegateCall: - case FunctionType::Kind::BareStaticCall: -+ case FunctionType::Kind::BareAuthCall: - case FunctionType::Kind::Transfer: - case FunctionType::Kind::ECRecover: - case FunctionType::Kind::SHA256: -@@ -1826,7 +1828,7 @@ bool ExpressionCompiler::visit(MemberAccess const& _memberAccess) - true - ); - } -- else if ((std::set{"call", "callcode", "delegatecall", "staticcall"}).count(member)) -+ else if ((std::set{"call", "callcode", "delegatecall", "staticcall", "authcall"}).count(member)) - utils().convertType( - *_memberAccess.expression().annotation().type, - *TypeProvider::address(), -@@ -2652,8 +2654,9 @@ void ExpressionCompiler::appendExternalFunctionCall( - - solAssert(funKind != FunctionType::Kind::BareCallCode, "Callcode has been removed."); - -- bool returnSuccessConditionAndReturndata = funKind == FunctionType::Kind::BareCall || funKind == FunctionType::Kind::BareDelegateCall || funKind == FunctionType::Kind::BareStaticCall; -+ bool returnSuccessConditionAndReturndata = funKind == FunctionType::Kind::BareCall || funKind == FunctionType::Kind::BareDelegateCall || funKind == FunctionType::Kind::BareStaticCall || funKind == FunctionType::Kind::BareAuthCall; - bool isDelegateCall = funKind == FunctionType::Kind::BareDelegateCall || funKind == FunctionType::Kind::DelegateCall; -+ bool isAuthCall = funKind == FunctionType::Kind::BareAuthCall; - bool useStaticCall = funKind == FunctionType::Kind::BareStaticCall || (_functionType.stateMutability() <= StateMutability::View && m_context.evmVersion().hasStaticCall()); - - if (_tryCall) -@@ -2814,6 +2817,8 @@ void ExpressionCompiler::appendExternalFunctionCall( - // Order is important here, STATICCALL might overlap with DELEGATECALL. - if (isDelegateCall) - m_context << Instruction::DELEGATECALL; -+ else if (isAuthCall) -+ m_context << Instruction::AUTHCALL; - else if (useStaticCall) - m_context << Instruction::STATICCALL; - else -diff --git a/libsolidity/codegen/ReturnInfo.cpp b/libsolidity/codegen/ReturnInfo.cpp -index 28518d9b2..7ddac6312 100644 ---- a/libsolidity/codegen/ReturnInfo.cpp -+++ b/libsolidity/codegen/ReturnInfo.cpp -@@ -31,7 +31,8 @@ ReturnInfo::ReturnInfo(EVMVersion const& _evmVersion, FunctionType const& _funct - bool const returnSuccessConditionAndReturndata = - funKind == FunctionType::Kind::BareCall || - funKind == FunctionType::Kind::BareDelegateCall || -- funKind == FunctionType::Kind::BareStaticCall; -+ funKind == FunctionType::Kind::BareStaticCall || -+ funKind == FunctionType::Kind::BareAuthCall; - - if (!returnSuccessConditionAndReturndata) - { -diff --git a/libsolidity/codegen/ir/IRGeneratorForStatements.cpp b/libsolidity/codegen/ir/IRGeneratorForStatements.cpp -index a5196366f..e09495fb7 100644 ---- a/libsolidity/codegen/ir/IRGeneratorForStatements.cpp -+++ b/libsolidity/codegen/ir/IRGeneratorForStatements.cpp -@@ -1040,6 +1040,7 @@ void IRGeneratorForStatements::endVisit(FunctionCall const& _functionCall) - case FunctionType::Kind::BareCall: - case FunctionType::Kind::BareDelegateCall: - case FunctionType::Kind::BareStaticCall: -+ case FunctionType::Kind::BareAuthCall: - appendBareCall(_functionCall, arguments); - break; - case FunctionType::Kind::BareCallCode: -@@ -1803,7 +1804,7 @@ void IRGeneratorForStatements::endVisit(MemberAccess const& _memberAccess) - solAssert(dynamic_cast(*_memberAccess.expression().annotation().type).stateMutability() == StateMutability::Payable); - define(IRVariable{_memberAccess}.part("address"), _memberAccess.expression()); - } -- else if (std::set{"call", "callcode", "delegatecall", "staticcall"}.count(member)) -+ else if (std::set{"call", "callcode", "delegatecall", "staticcall", "authcall"}.count(member)) - define(IRVariable{_memberAccess}.part("address"), _memberAccess.expression()); - else - solAssert(false, "Invalid member access to address"); -@@ -2144,6 +2145,7 @@ void IRGeneratorForStatements::endVisit(MemberAccess const& _memberAccess) - case FunctionType::Kind::BareCallCode: - case FunctionType::Kind::BareDelegateCall: - case FunctionType::Kind::BareStaticCall: -+ case FunctionType::Kind::BareAuthCall: - case FunctionType::Kind::Transfer: - case FunctionType::Kind::ECRecover: - case FunctionType::Kind::SHA256: -@@ -2722,7 +2724,8 @@ void IRGeneratorForStatements::appendBareCall( - solAssert( - funKind == FunctionType::Kind::BareCall || - funKind == FunctionType::Kind::BareDelegateCall || -- funKind == FunctionType::Kind::BareStaticCall, "" -+ funKind == FunctionType::Kind::BareStaticCall || -+ funKind == FunctionType::Kind::BareAuthCall, "" - ); - - solAssert(!_functionCall.annotation().tryCall); -@@ -2760,10 +2763,15 @@ void IRGeneratorForStatements::appendBareCall( - - templ("address", IRVariable(_functionCall.expression()).part("address").name()); - -- if (funKind == FunctionType::Kind::BareCall) -+ if (funKind == FunctionType::Kind::BareCall || funKind == FunctionType::Kind::BareAuthCall) - { -+ // Both `CALL` & `AUTHCALL` have a `value` field - templ("value", funType.valueSet() ? IRVariable(_functionCall.expression()).part("value").name() : "0"); -- templ("call", "call"); -+ -+ if (funKind == FunctionType::Kind::BareCall) -+ templ("call", "call"); -+ else -+ templ("call", "authcall"); - } - else - { -diff --git a/libsolidity/codegen/ir/IRGeneratorForStatements.h b/libsolidity/codegen/ir/IRGeneratorForStatements.h -index f4ce2a7d0..a25e1c42b 100644 ---- a/libsolidity/codegen/ir/IRGeneratorForStatements.h -+++ b/libsolidity/codegen/ir/IRGeneratorForStatements.h -@@ -162,7 +162,7 @@ private: - std::vector> const& _arguments - ); - -- /// Appends code for .call / .delegatecall / .staticcall. -+ /// Appends code for .call / .delegatecall / .staticcall / .authcall. - /// All involved expressions have already been visited. - void appendBareCall( - FunctionCall const& _functionCall, -diff --git a/test/tools/yulInterpreter/EVMInstructionInterpreter.cpp b/test/tools/yulInterpreter/EVMInstructionInterpreter.cpp -index 79dbc554a..ddabdb8d3 100644 ---- a/test/tools/yulInterpreter/EVMInstructionInterpreter.cpp -+++ b/test/tools/yulInterpreter/EVMInstructionInterpreter.cpp -@@ -351,6 +351,13 @@ u256 EVMInstructionInterpreter::eval( - (arg[0] > 0) && - (arg[1] == util::h160::Arith(m_state.address) || (arg[1] & 1)) - ) ? 1 : 0; -+ case Instruction::AUTH: -+ accessMemory(arg[1], arg[2]); -+ return 0; -+ case Instruction::AUTHCALL: -+ accessMemory(arg[4], arg[5]); -+ accessMemory(arg[6], arg[7]); -+ return 0; - case Instruction::RETURN: - { - m_state.returndata = {}; diff --git a/patches/solidity b/patches/solidity new file mode 160000 index 0000000..187a178 --- /dev/null +++ b/patches/solidity @@ -0,0 +1 @@ +Subproject commit 187a178a7b82ebccf06e84bed88a77ff611c7c66 From 60054fa2743abc0e07fdfd5b78cf9b696c66c2d3 Mon Sep 17 00:00:00 2001 From: jxom Date: Wed, 1 May 2024 09:51:31 +1000 Subject: [PATCH 3/3] Update docker.yml --- .github/workflows/docker.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 9b7413e..84072e4 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -4,7 +4,6 @@ on: push: branches: - main - workflow_dispatch: permissions: packages: write