diff --git a/.github/workflows/unit.yaml b/.github/workflows/unit.yaml index 5dcf3aa62..b709cd4b5 100644 --- a/.github/workflows/unit.yaml +++ b/.github/workflows/unit.yaml @@ -17,6 +17,8 @@ jobs: steps: - name: Checkout sources uses: actions/checkout@v3 + with: + submodules: 'recursive' - name: Install toolchain uses: dtolnay/rust-toolchain@stable diff --git a/.gitmodules b/.gitmodules index b19f910ea..649faf2ad 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,15 +1,23 @@ -[submodule "crates/types/contracts/lib/account-abstraction"] - path = crates/types/contracts/lib/account-abstraction +[submodule "crates/types/contracts/lib/account-abstraction-versions/v0_7"] + path = crates/types/contracts/lib/account-abstraction-versions/v0_7 url = https://github.com/eth-infinitism/account-abstraction - branch = v0.5 + branch = releases/v0.7 +[submodule "crates/types/contracts/lib/account-abstraction-versions/v0_6"] + path = crates/types/contracts/lib/account-abstraction-versions/v0_6 + url = https://github.com/eth-infinitism/account-abstraction + branch = releases/v0.6 [submodule "crates/types/contracts/lib/forge-std"] path = crates/types/contracts/lib/forge-std url = https://github.com/foundry-rs/forge-std branch = chore/v1.5.0 -[submodule "crates/types/contracts/lib/openzeppelin-contracts"] - path = crates/types/contracts/lib/openzeppelin-contracts +[submodule "crates/types/contracts/lib/openzeppelin-contracts-versions/v5_0"] + path = crates/types/contracts/lib/openzeppelin-contracts-versions/v5_0 + url = https://github.com/OpenZeppelin/openzeppelin-contracts + branch = release-v5.0 +[submodule "crates/types/contracts/lib/openzeppelin-contracts-versions/v4_9"] + path = crates/types/contracts/lib/openzeppelin-contracts-versions/v4_9 url = https://github.com/OpenZeppelin/openzeppelin-contracts - branch = release-v4.8 + branch = release-v4.9 [submodule "test/spec-tests/bundler-spec-tests"] path = test/spec-tests/bundler-spec-tests url = https://github.com/alchemyplatform/bundler-spec-tests.git diff --git a/bin/tools/src/bin/send_ops.rs b/bin/tools/src/bin/send_ops.rs index b8b06b597..ff0c66057 100644 --- a/bin/tools/src/bin/send_ops.rs +++ b/bin/tools/src/bin/send_ops.rs @@ -28,7 +28,7 @@ async fn main() -> anyhow::Result<()> { // simply call the nonce method multiple times for i in 0..10 { println!("Sending op {i}"); - let op = clients.new_wallet_op(wallet.nonce(), 0.into()).await?; + let op = clients.new_wallet_op(wallet.get_nonce(), 0.into()).await?; let call = entry_point.handle_ops(vec![op], bundler_client.address()); rundler_dev::await_mined_tx(call.send(), "send user operation").await?; } diff --git a/crates/dev/src/lib.rs b/crates/dev/src/lib.rs index 25b08ab11..7fe999e55 100644 --- a/crates/dev/src/lib.rs +++ b/crates/dev/src/lib.rs @@ -42,7 +42,7 @@ use ethers::{ utils::{self, hex, keccak256}, }; use rundler_types::{ - contracts::{ + contracts::v0_6::{ entry_point::EntryPoint, simple_account::SimpleAccount, simple_account_factory::SimpleAccountFactory, verifying_paymaster::VerifyingPaymaster, }, @@ -470,7 +470,7 @@ impl DevClients { .context("call executed by wallet should have to address")?; let nonce = self .wallet - .nonce() + .get_nonce() .await .context("should read nonce from wallet")?; let call_data = Bytes::clone( diff --git a/crates/pool/src/chain.rs b/crates/pool/src/chain.rs index 04f015720..b35bfcb3c 100644 --- a/crates/pool/src/chain.rs +++ b/crates/pool/src/chain.rs @@ -27,7 +27,7 @@ use futures::future; use rundler_provider::Provider; use rundler_task::block_watcher; use rundler_types::{ - contracts::{ + contracts::v0_6::{ entry_point::{DepositedFilter, WithdrawnFilter}, i_entry_point::UserOperationEventFilter, }, diff --git a/crates/provider/src/ethers/entry_point.rs b/crates/provider/src/ethers/entry_point.rs index 4cfebc4ee..f7b8ef158 100644 --- a/crates/provider/src/ethers/entry_point.rs +++ b/crates/provider/src/ethers/entry_point.rs @@ -25,7 +25,7 @@ use ethers::{ utils::hex, }; use rundler_types::{ - contracts::{ + contracts::v0_6::{ get_balances::{GetBalancesResult, GETBALANCES_BYTECODE}, i_entry_point::{ExecutionResult, FailedOp, IEntryPoint, SignatureValidationFailed}, shared_types::UserOpsPerAggregator, diff --git a/crates/provider/src/ethers/provider.rs b/crates/provider/src/ethers/provider.rs index 3b2c3acc9..4fcef0b33 100644 --- a/crates/provider/src/ethers/provider.rs +++ b/crates/provider/src/ethers/provider.rs @@ -32,8 +32,9 @@ use ethers::{ use reqwest::Url; use rundler_types::{ contracts::{ - gas_price_oracle::GasPriceOracle, i_aggregator::IAggregator, i_entry_point::IEntryPoint, - node_interface::NodeInterface, + arbitrum::node_interface::NodeInterface, + optimism::gas_price_oracle::GasPriceOracle, + v0_6::{i_aggregator::IAggregator, i_entry_point::IEntryPoint}, }, UserOperation, }; diff --git a/crates/provider/src/traits/entry_point.rs b/crates/provider/src/traits/entry_point.rs index 93c1adf3f..6a67c3563 100644 --- a/crates/provider/src/traits/entry_point.rs +++ b/crates/provider/src/traits/entry_point.rs @@ -17,7 +17,7 @@ use ethers::types::{ #[cfg(feature = "test-utils")] use mockall::automock; use rundler_types::{ - contracts::{i_entry_point::ExecutionResult, shared_types::UserOpsPerAggregator}, + contracts::v0_6::{i_entry_point::ExecutionResult, shared_types::UserOpsPerAggregator}, DepositInfo, GasFees, UserOperation, ValidationOutput, }; diff --git a/crates/rpc/src/eth/api.rs b/crates/rpc/src/eth/api.rs index 4ec65b905..f58b2d110 100644 --- a/crates/rpc/src/eth/api.rs +++ b/crates/rpc/src/eth/api.rs @@ -35,7 +35,7 @@ use rundler_sim::{ }; use rundler_types::{ chain::ChainSpec, - contracts::i_entry_point::{ + contracts::v0_6::i_entry_point::{ IEntryPointCalls, UserOperationEventFilter, UserOperationRevertReasonFilter, }, UserOperation, @@ -567,7 +567,7 @@ mod tests { use rundler_pool::{MockPoolServer, PoolOperation}; use rundler_provider::{MockEntryPoint, MockProvider}; use rundler_sim::PriorityFeeMode; - use rundler_types::contracts::i_entry_point::HandleOpsCall; + use rundler_types::contracts::v0_6::i_entry_point::HandleOpsCall; use super::*; diff --git a/crates/sim/src/estimation/estimation.rs b/crates/sim/src/estimation/estimation.rs index 2daac5c33..939b0250f 100644 --- a/crates/sim/src/estimation/estimation.rs +++ b/crates/sim/src/estimation/estimation.rs @@ -30,7 +30,7 @@ use rand::Rng; use rundler_provider::{EntryPoint, Provider}; use rundler_types::{ chain::ChainSpec, - contracts::{ + contracts::v0_6::{ call_gas_estimation_proxy::{ EstimateCallGasArgs, EstimateCallGasCall, EstimateCallGasContinuation, EstimateCallGasResult, EstimateCallGasRevertAtMax, @@ -452,7 +452,7 @@ mod tests { use rundler_provider::{MockEntryPoint, MockProvider}; use rundler_types::{ chain::L1GasOracleContractType, - contracts::{get_gas_used::GasUsedResult, i_entry_point::ExecutionResult}, + contracts::{utils::get_gas_used::GasUsedResult, v0_6::i_entry_point::ExecutionResult}, }; use super::*; diff --git a/crates/sim/src/simulation/simulation.rs b/crates/sim/src/simulation/simulation.rs index 602e82335..9e0d5aef2 100644 --- a/crates/sim/src/simulation/simulation.rs +++ b/crates/sim/src/simulation/simulation.rs @@ -29,8 +29,8 @@ use indexmap::IndexSet; use mockall::automock; use rundler_provider::{AggregatorOut, AggregatorSimOut, Provider}; use rundler_types::{ - contracts::i_entry_point::FailedOp, Entity, EntityType, StakeInfo, StorageSlot, UserOperation, - ValidTimeRange, ValidationOutput, ValidationReturnInfo, + contracts::v0_6::i_entry_point::FailedOp, Entity, EntityType, StakeInfo, StorageSlot, + UserOperation, ValidTimeRange, ValidationOutput, ValidationReturnInfo, }; use strum::IntoEnumIterator; @@ -1052,7 +1052,7 @@ mod tests { utils::hex, }; use rundler_provider::{AggregatorOut, MockProvider}; - use rundler_types::contracts::get_code_hashes::CodeHashesResult; + use rundler_types::contracts::utils::get_code_hashes::CodeHashesResult; use super::*; use crate::simulation::tracer::{MockSimulateValidationTracer, Phase}; diff --git a/crates/sim/src/utils.rs b/crates/sim/src/utils.rs index ac26b522a..f60d12d68 100644 --- a/crates/sim/src/utils.rs +++ b/crates/sim/src/utils.rs @@ -17,7 +17,7 @@ use ethers::{ types::{spoof, Address, BlockId, Bytes, Selector, H256, U256}, }; use rundler_provider::Provider; -use rundler_types::contracts::{ +use rundler_types::contracts::utils::{ get_code_hashes::{CodeHashesResult, GETCODEHASHES_BYTECODE}, get_gas_used::{GasUsedResult, GETGASUSED_BYTECODE}, }; diff --git a/crates/types/.gitignore b/crates/types/.gitignore index 1eb781682..8e68a7764 100644 --- a/crates/types/.gitignore +++ b/crates/types/.gitignore @@ -1,2 +1,6 @@ # Generated code -/src/contracts +/src/contracts/v0_6 +/src/contracts/v0_7 +/src/contracts/arbitrum +/src/contracts/optimism +/src/contracts/utils diff --git a/crates/types/build.rs b/crates/types/build.rs index 9a43ee637..e91b29a36 100644 --- a/crates/types/build.rs +++ b/crates/types/build.rs @@ -19,48 +19,146 @@ fn main() -> Result<(), Box> { println!("cargo:rerun-if-changed=contracts/lib"); println!("cargo:rerun-if-changed=contracts/src"); println!("cargo:rerun-if-changed=contracts/foundry.toml"); - generate_contract_bindings()?; + generate_v0_6_bindings()?; + generate_v0_7_bindings()?; + generate_utils_bindings()?; + generate_arbitrum_bindings()?; + generate_optimism_bindings()?; Ok(()) } -fn generate_contract_bindings() -> Result<(), Box> { - generate_abis()?; +fn generate_v0_6_bindings() -> Result<(), Box> { + run_command( + Command::new("forge") + .arg("build") + .arg("--root") + .arg("./contracts") + .arg("--contracts") + .arg("src/v0_6") + .arg("--out") + .arg("out/v0_6") + .arg("--remappings") + .arg("@openzeppelin/=lib/openzeppelin-contracts-versions/v4_9"), + "https://getfoundry.sh/", + "generate ABIs", + )?; + MultiAbigen::from_abigens([ - abigen_of("IEntryPoint")?, - abigen_of("EntryPoint")?, - abigen_of("IAggregator")?, - abigen_of("IStakeManager")?, - abigen_of("GetCodeHashes")?, - abigen_of("GetBalances")?, - abigen_of("GetGasUsed")?, - abigen_of("CallGasEstimationProxy")?, - abigen_of("SimpleAccount")?, - abigen_of("SimpleAccountFactory")?, - abigen_of("VerifyingPaymaster")?, - abigen_of("NodeInterface")?, - abigen_of("GasPriceOracle")?, + abigen_of("v0_6", "IEntryPoint")?, + abigen_of("v0_6", "EntryPoint")?, + abigen_of("v0_6", "IAggregator")?, + abigen_of("v0_6", "IStakeManager")?, + abigen_of("v0_6", "GetBalances")?, + abigen_of("v0_6", "CallGasEstimationProxy")?, + abigen_of("v0_6", "SimpleAccount")?, + abigen_of("v0_6", "SimpleAccountFactory")?, + abigen_of("v0_6", "VerifyingPaymaster")?, ]) .build()? - .write_to_module("src/contracts", false)?; + .write_to_module("src/contracts/v0_6", false)?; + Ok(()) } -fn abigen_of(contract: &str) -> Result> { - Ok(Abigen::new( - contract, - format!("contracts/out/{contract}.sol/{contract}.json"), - )?) +fn generate_v0_7_bindings() -> Result<(), Box> { + run_command( + Command::new("forge") + .arg("build") + .arg("--root") + .arg("./contracts") + .arg("--contracts") + .arg("src/v0_7") + .arg("--out") + .arg("out/v0_7") + .arg("--remappings") + .arg("@openzeppelin/=lib/openzeppelin-contracts-versions/v5_0"), + "https://getfoundry.sh/", + "generate ABIs", + )?; + + MultiAbigen::from_abigens([ + abigen_of("v0_7", "IEntryPoint")?, + abigen_of("v0_7", "EntryPoint")?, + abigen_of("v0_7", "IAggregator")?, + abigen_of("v0_7", "IStakeManager")?, + ]) + .build()? + .write_to_module("src/contracts/v0_7", false)?; + + Ok(()) +} + +fn generate_utils_bindings() -> Result<(), Box> { + run_command( + Command::new("forge") + .arg("build") + .arg("--root") + .arg("./contracts") + .arg("--contracts") + .arg("src/utils") + .arg("--out") + .arg("out/utils"), + "https://getfoundry.sh/", + "generate ABIs", + )?; + + MultiAbigen::from_abigens([ + abigen_of("utils", "GetCodeHashes")?, + abigen_of("utils", "GetGasUsed")?, + ]) + .build()? + .write_to_module("src/contracts/utils", false)?; + + Ok(()) +} + +fn generate_arbitrum_bindings() -> Result<(), Box> { + run_command( + Command::new("forge") + .arg("build") + .arg("--root") + .arg("./contracts") + .arg("--contracts") + .arg("src/arbitrum") + .arg("--out") + .arg("out/arbitrum"), + "https://getfoundry.sh/", + "generate ABIs", + )?; + + MultiAbigen::from_abigens([abigen_of("arbitrum", "NodeInterface")?]) + .build()? + .write_to_module("src/contracts/arbitrum", false)?; + + Ok(()) } -fn generate_abis() -> Result<(), Box> { +fn generate_optimism_bindings() -> Result<(), Box> { run_command( Command::new("forge") .arg("build") .arg("--root") - .arg("./contracts"), + .arg("./contracts") + .arg("--contracts") + .arg("src/optimism") + .arg("--out") + .arg("out/optimism"), "https://getfoundry.sh/", "generate ABIs", - ) + )?; + + MultiAbigen::from_abigens([abigen_of("optimism", "GasPriceOracle")?]) + .build()? + .write_to_module("src/contracts/optimism", false)?; + + Ok(()) +} + +fn abigen_of(extra_path: &str, contract: &str) -> Result> { + Ok(Abigen::new( + contract, + format!("contracts/out/{extra_path}/{contract}.sol/{contract}.json"), + )?) } fn run_command( diff --git a/crates/types/contracts/foundry.toml b/crates/types/contracts/foundry.toml index d82db5af8..0705faad6 100644 --- a/crates/types/contracts/foundry.toml +++ b/crates/types/contracts/foundry.toml @@ -4,10 +4,11 @@ out = 'out' libs = ['lib'] test = 'test' cache_path = 'cache' +solc_version = '0.8.23' remappings = [ 'forge-std/=lib/forge-std/src', 'ds-test/=lib/forge-std/lib/ds-test/src/', - 'account-abstraction/=lib/account-abstraction/contracts/', - '@openzeppelin/=lib/openzeppelin-contracts/' + 'account-abstraction/v0_6=lib/account-abstraction-versions/v0_6/contracts/', + 'account-abstraction/v0_7=lib/account-abstraction-versions/v0_7/contracts/', ] diff --git a/crates/types/contracts/lib/account-abstraction b/crates/types/contracts/lib/account-abstraction deleted file mode 160000 index f3b5f7955..000000000 --- a/crates/types/contracts/lib/account-abstraction +++ /dev/null @@ -1 +0,0 @@ -Subproject commit f3b5f795515ad8a7a7bf447575d6554854b820da diff --git a/crates/types/contracts/lib/account-abstraction-versions/v0_6 b/crates/types/contracts/lib/account-abstraction-versions/v0_6 new file mode 160000 index 000000000..fa61290d3 --- /dev/null +++ b/crates/types/contracts/lib/account-abstraction-versions/v0_6 @@ -0,0 +1 @@ +Subproject commit fa61290d37d079e928d92d53a122efcc63822214 diff --git a/crates/types/contracts/lib/account-abstraction-versions/v0_7 b/crates/types/contracts/lib/account-abstraction-versions/v0_7 new file mode 160000 index 000000000..7af70c899 --- /dev/null +++ b/crates/types/contracts/lib/account-abstraction-versions/v0_7 @@ -0,0 +1 @@ +Subproject commit 7af70c8993a6f42973f520ae0752386a5032abe7 diff --git a/crates/types/contracts/lib/openzeppelin-contracts b/crates/types/contracts/lib/openzeppelin-contracts deleted file mode 160000 index 0a25c1940..000000000 --- a/crates/types/contracts/lib/openzeppelin-contracts +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 0a25c1940ca220686588c4af3ec526f725fe2582 diff --git a/crates/types/contracts/lib/openzeppelin-contracts-versions/v4_9 b/crates/types/contracts/lib/openzeppelin-contracts-versions/v4_9 new file mode 160000 index 000000000..dc44c9f1a --- /dev/null +++ b/crates/types/contracts/lib/openzeppelin-contracts-versions/v4_9 @@ -0,0 +1 @@ +Subproject commit dc44c9f1a4c3b10af99492eed84f83ed244203f6 diff --git a/crates/types/contracts/lib/openzeppelin-contracts-versions/v5_0 b/crates/types/contracts/lib/openzeppelin-contracts-versions/v5_0 new file mode 160000 index 000000000..dbb6104ce --- /dev/null +++ b/crates/types/contracts/lib/openzeppelin-contracts-versions/v5_0 @@ -0,0 +1 @@ +Subproject commit dbb6104ce834628e473d2173bbc9d47f81a9eec3 diff --git a/crates/types/contracts/src/imports.sol b/crates/types/contracts/src/imports.sol deleted file mode 100644 index cc0cd33e3..000000000 --- a/crates/types/contracts/src/imports.sol +++ /dev/null @@ -1,11 +0,0 @@ -// SPDX-License-Identifier: UNLICENSED -pragma solidity ^0.8.13; - -// Simply importing a dependency is enough for Forge to include it in builds. - -import "account-abstraction/samples/SimpleAccount.sol"; -import "account-abstraction/samples/SimpleAccountFactory.sol"; -import "account-abstraction/samples/VerifyingPaymaster.sol"; -import "account-abstraction/core/EntryPoint.sol"; -import "account-abstraction/interfaces/IAggregator.sol"; -import "account-abstraction/interfaces/IStakeManager.sol"; diff --git a/crates/types/contracts/src/GetCodeHashes.sol b/crates/types/contracts/src/utils/GetCodeHashes.sol similarity index 100% rename from crates/types/contracts/src/GetCodeHashes.sol rename to crates/types/contracts/src/utils/GetCodeHashes.sol diff --git a/crates/types/contracts/src/GetGasUsed.sol b/crates/types/contracts/src/utils/GetGasUsed.sol similarity index 100% rename from crates/types/contracts/src/GetGasUsed.sol rename to crates/types/contracts/src/utils/GetGasUsed.sol diff --git a/crates/types/contracts/src/CallGasEstimationProxy.sol b/crates/types/contracts/src/v0_6/CallGasEstimationProxy.sol similarity index 99% rename from crates/types/contracts/src/CallGasEstimationProxy.sol rename to crates/types/contracts/src/v0_6/CallGasEstimationProxy.sol index 331c31732..95143682c 100644 --- a/crates/types/contracts/src/CallGasEstimationProxy.sol +++ b/crates/types/contracts/src/v0_6/CallGasEstimationProxy.sol @@ -1,7 +1,7 @@ // SPDX-License-Identifier: UNLICENSED pragma solidity ^0.8.13; -import "account-abstraction/interfaces/IEntryPoint.sol"; +import "account-abstraction/v0_6/interfaces/IEntryPoint.sol"; import "@openzeppelin/contracts/proxy/Proxy.sol"; import "@openzeppelin/contracts/utils/math/Math.sol"; diff --git a/crates/types/contracts/src/GetBalances.sol b/crates/types/contracts/src/v0_6/GetBalances.sol similarity index 91% rename from crates/types/contracts/src/GetBalances.sol rename to crates/types/contracts/src/v0_6/GetBalances.sol index fa94d0f1d..e857bdb38 100644 --- a/crates/types/contracts/src/GetBalances.sol +++ b/crates/types/contracts/src/v0_6/GetBalances.sol @@ -1,7 +1,7 @@ // SPDX-License-Identifier: GPL-3.0-only pragma solidity ^0.8.12; -import "account-abstraction/interfaces/IStakeManager.sol"; +import "account-abstraction/v0_6/interfaces/IStakeManager.sol"; contract GetBalances { error GetBalancesResult(uint256[] balances); diff --git a/crates/types/contracts/src/PrecompileAccount.sol b/crates/types/contracts/src/v0_6/PrecompileAccount.sol similarity index 94% rename from crates/types/contracts/src/PrecompileAccount.sol rename to crates/types/contracts/src/v0_6/PrecompileAccount.sol index 311658507..3c0372048 100644 --- a/crates/types/contracts/src/PrecompileAccount.sol +++ b/crates/types/contracts/src/v0_6/PrecompileAccount.sol @@ -1,7 +1,7 @@ // SPDX-License-Identifier: GPL-3.0 pragma solidity ^0.8.13; -import "account-abstraction/interfaces/IAccount.sol"; +import "account-abstraction/v0_6/interfaces/IAccount.sol"; contract PrecompileAccount is IAccount { address public precompile; diff --git a/crates/types/contracts/src/v0_6/imports.sol b/crates/types/contracts/src/v0_6/imports.sol new file mode 100644 index 000000000..fbb9f4ab1 --- /dev/null +++ b/crates/types/contracts/src/v0_6/imports.sol @@ -0,0 +1,11 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.13; + +// Simply importing a dependency is enough for Forge to include it in builds. + +import "account-abstraction/v0_6/samples/SimpleAccount.sol"; +import "account-abstraction/v0_6/samples/SimpleAccountFactory.sol"; +import "account-abstraction/v0_6/samples/VerifyingPaymaster.sol"; +import "account-abstraction/v0_6/core/EntryPoint.sol"; +import "account-abstraction/v0_6/interfaces/IAggregator.sol"; +import "account-abstraction/v0_6/interfaces/IStakeManager.sol"; diff --git a/crates/types/contracts/src/v0_7/imports.sol b/crates/types/contracts/src/v0_7/imports.sol new file mode 100644 index 000000000..72be598ea --- /dev/null +++ b/crates/types/contracts/src/v0_7/imports.sol @@ -0,0 +1,8 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.13; + +// Simply importing a dependency is enough for Forge to include it in builds. + +import "account-abstraction/v0_7/core/EntryPoint.sol"; +import "account-abstraction/v0_7/interfaces/IAggregator.sol"; +import "account-abstraction/v0_7/interfaces/IStakeManager.sol"; diff --git a/crates/types/contracts/test/PrecompileAccountTest.sol b/crates/types/contracts/test/PrecompileAccountTest.sol index 8b59023bd..7ed89f0d7 100644 --- a/crates/types/contracts/test/PrecompileAccountTest.sol +++ b/crates/types/contracts/test/PrecompileAccountTest.sol @@ -1,8 +1,8 @@ // SPDX-License-Identifier: UNLICENSED pragma solidity ^0.8.14; -import "../src/PrecompileAccount.sol"; -import "account-abstraction/interfaces/UserOperation.sol"; +import "../src/v0_6/PrecompileAccount.sol"; +import "account-abstraction/v0_6/interfaces/UserOperation.sol"; import "forge-std/Test.sol"; contract PrecompileAccountTest is Test { diff --git a/crates/types/src/contracts/mod.rs b/crates/types/src/contracts/mod.rs new file mode 100644 index 000000000..796006a37 --- /dev/null +++ b/crates/types/src/contracts/mod.rs @@ -0,0 +1,24 @@ +// This file is part of Rundler. +// +// Rundler is free software: you can redistribute it and/or modify it under the +// terms of the GNU Lesser General Public License as published by the Free Software +// Foundation, either version 3 of the License, or (at your option) any later version. +// +// Rundler is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; +// without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +// See the GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along with Rundler. +// If not, see https://www.gnu.org/licenses/. + +//! Generated contract interfaces + +#![allow(non_snake_case)] +#![allow(clippy::all)] +#![allow(missing_docs)] + +pub mod arbitrum; +pub mod optimism; +pub mod utils; +pub mod v0_6; +pub mod v0_7; diff --git a/crates/types/src/lib.rs b/crates/types/src/lib.rs index fe9b7e8f1..bd39a791c 100644 --- a/crates/types/src/lib.rs +++ b/crates/types/src/lib.rs @@ -22,13 +22,8 @@ pub mod chain; -/// Generated contracts module -#[allow(non_snake_case)] -#[rustfmt::skip] -#[allow(clippy::all)] -#[allow(missing_docs)] pub mod contracts; -pub use contracts::shared_types::{DepositInfo, UserOperation, UserOpsPerAggregator}; +pub use contracts::v0_6::shared_types::{DepositInfo, UserOperation, UserOpsPerAggregator}; mod entity; pub use entity::{Entity, EntityType, EntityUpdate, EntityUpdateType}; diff --git a/crates/types/src/validation_results.rs b/crates/types/src/validation_results.rs index 695738210..dad3659be 100644 --- a/crates/types/src/validation_results.rs +++ b/crates/types/src/validation_results.rs @@ -18,7 +18,7 @@ use ethers::{ }; use crate::{ - contracts::entry_point::{ValidationResult, ValidationResultWithAggregation}, + contracts::v0_6::entry_point::{ValidationResult, ValidationResultWithAggregation}, Timestamp, };