diff --git a/crates/e2e/src/setup/services.rs b/crates/e2e/src/setup/services.rs index d7de0b2718..1e7103861f 100644 --- a/crates/e2e/src/setup/services.rs +++ b/crates/e2e/src/setup/services.rs @@ -113,12 +113,10 @@ impl<'a> Services<'a> { pub async fn start_api(&self, extra_args: Vec) { let args = [ "orderbook".to_string(), - "--enable-custom-interactions=true".to_string(), format!( "--hooks-contract-address={:?}", self.contracts.hooks.address() ), - "--enable-eth-smart-contract-payments=true".to_string(), ] .into_iter() .chain(self.api_autopilot_solver_arguments()) diff --git a/crates/orderbook/openapi.yml b/crates/orderbook/openapi.yml index 4e4e9b0516..2a97763042 100644 --- a/crates/orderbook/openapi.yml +++ b/crates/orderbook/openapi.yml @@ -1202,11 +1202,9 @@ components: UnsupportedOrderType, InsufficientValidTo, ExcessiveValidTo, - TransferEthToContract, InvalidNativeSellToken, SameBuyAndSellToken, UnsupportedToken, - UnsupportedCustomInteraction InvalidAppData, AppDataHashMismatch, AppdataFromMismatch, @@ -1254,7 +1252,6 @@ components: InsufficientValidTo, ExcessiveValidTo, InvalidSignature, - TransferEthToContract, TransferSimulationFailed, UnsupportedToken, WrongOwner, diff --git a/crates/orderbook/src/api/post_order.rs b/crates/orderbook/src/api/post_order.rs index a78761aeeb..bf8971c663 100644 --- a/crates/orderbook/src/api/post_order.rs +++ b/crates/orderbook/src/api/post_order.rs @@ -60,13 +60,6 @@ impl IntoWarpReply for PartialValidationErrorWrapper { error("ExcessiveValidTo", "validTo is too far into the future"), StatusCode::BAD_REQUEST, ), - PartialValidationError::TransferEthToContract => with_status( - error( - "TransferEthToContract", - "Sending Ether to smart contract wallets is currently not supported", - ), - StatusCode::BAD_REQUEST, - ), PartialValidationError::InvalidNativeSellToken => with_status( error( "InvalidNativeSellToken", @@ -100,13 +93,6 @@ pub struct AppDataValidationErrorWrapper(pub AppDataValidationError); impl IntoWarpReply for AppDataValidationErrorWrapper { fn into_warp_reply(self) -> ApiReply { match self.0 { - AppDataValidationError::UnsupportedCustomInteraction => with_status( - error( - "UnsupportedCustomInteraction", - "The specified custom pre- or post- interaction is unsupported", - ), - StatusCode::BAD_REQUEST, - ), AppDataValidationError::Invalid(err) => with_status( error("InvalidAppData", format!("{:?}", err)), StatusCode::BAD_REQUEST, diff --git a/crates/orderbook/src/arguments.rs b/crates/orderbook/src/arguments.rs index bd574154ba..0ba214617f 100644 --- a/crates/orderbook/src/arguments.rs +++ b/crates/orderbook/src/arguments.rs @@ -125,14 +125,6 @@ pub struct Arguments { #[clap(long, env, default_value = "10")] pub max_limit_orders_per_user: u64, - /// Enable buy ETH orders paying to smart contract wallets. - #[clap(long, env, action = clap::ArgAction::Set, default_value = "false")] - pub enable_eth_smart_contract_payments: bool, - - /// Enable support for orders with custom pre- and post-interactions. - #[clap(long, env, action = clap::ArgAction::Set, default_value = "false")] - pub enable_custom_interactions: bool, - /// If set, the orderbook will use this IPFS gateway to fetch full app data /// for orders that only specify the contract app data hash. #[clap(long, env)] @@ -176,13 +168,11 @@ impl std::fmt::Display for Arguments { native_price_estimators, fast_price_estimation_results_required, max_limit_orders_per_user, - enable_custom_interactions, ipfs_gateway, ipfs_pinata_auth, hooks_contract_address, app_data_size_limit, db_url, - enable_eth_smart_contract_payments, } = self; write!(f, "{}", shared)?; @@ -239,11 +229,6 @@ impl std::fmt::Display for Arguments { "max_limit_orders_per_user: {}", max_limit_orders_per_user )?; - writeln!( - f, - "enable_custom_interactions: {:?}", - enable_custom_interactions - )?; writeln!(f, "ipfs_gateway: {:?}", ipfs_gateway)?; display_secret_option(f, "ipfs_pinata_auth", ipfs_pinata_auth)?; display_option( @@ -252,11 +237,6 @@ impl std::fmt::Display for Arguments { &hooks_contract_address.map(|a| format!("{a:?}")), )?; writeln!(f, "app_data_size_limit: {}", app_data_size_limit)?; - writeln!( - f, - "enable_eth_smart_contract_payments: {}", - enable_eth_smart_contract_payments - )?; Ok(()) } diff --git a/crates/orderbook/src/run.rs b/crates/orderbook/src/run.rs index 381d70e090..fc8d61171a 100644 --- a/crates/orderbook/src/run.rs +++ b/crates/orderbook/src/run.rs @@ -474,8 +474,6 @@ pub async fn run(args: Arguments) { Arc::new(CachedCodeFetcher::new(Arc::new(web3.clone()))), app_data_validator.clone(), ) - .with_eth_smart_contract_payments(args.enable_eth_smart_contract_payments) - .with_custom_interactions(args.enable_custom_interactions) .with_verified_quotes(args.price_estimation.trade_simulator.is_some()), ); let ipfs = args diff --git a/crates/shared/src/order_validation.rs b/crates/shared/src/order_validation.rs index e5de4115e0..41a68dd53b 100644 --- a/crates/shared/src/order_validation.rs +++ b/crates/shared/src/order_validation.rs @@ -106,7 +106,6 @@ pub trait OrderValidating: Send + Sync { pub enum PartialValidationError { Forbidden, ValidTo(OrderValidToError), - TransferEthToContract, InvalidNativeSellToken, SameBuyAndSellToken, UnsupportedBuyTokenDestination(BuyTokenDestination), @@ -129,7 +128,6 @@ pub enum AppDataValidationError { actual: AppDataHash, }, Invalid(anyhow::Error), - UnsupportedCustomInteraction, } #[derive(Debug)] @@ -252,8 +250,6 @@ pub struct OrderValidator { limit_order_counter: Arc, max_limit_orders_per_user: u64, pub code_fetcher: Arc, - pub enable_eth_smart_contract_payments: bool, - enable_custom_interactions: bool, app_data_validator: crate::app_data::Validator, request_verified_quotes: bool, } @@ -344,23 +340,11 @@ impl OrderValidator { limit_order_counter, max_limit_orders_per_user, code_fetcher, - enable_eth_smart_contract_payments: false, - enable_custom_interactions: false, app_data_validator, request_verified_quotes: false, } } - pub fn with_eth_smart_contract_payments(mut self, enable: bool) -> Self { - self.enable_eth_smart_contract_payments = enable; - self - } - - pub fn with_custom_interactions(mut self, enable: bool) -> Self { - self.enable_custom_interactions = enable; - self - } - pub fn with_verified_quotes(mut self, enable: bool) -> Self { self.request_verified_quotes = enable; self @@ -454,16 +438,6 @@ impl OrderValidating for OrderValidator { if order.sell_token == BUY_ETH_ADDRESS { return Err(PartialValidationError::InvalidNativeSellToken); } - if !self.enable_eth_smart_contract_payments && order.buy_token == BUY_ETH_ADDRESS { - let code_size = self - .code_fetcher - .code_size(order.receiver) - .await - .map_err(PartialValidationError::Other)?; - if code_size != 0 { - return Err(PartialValidationError::TransferEthToContract); - } - } for &token in &[order.sell_token, order.buy_token] { if let TokenQuality::Bad { reason } = self @@ -522,11 +496,6 @@ impl OrderValidating for OrderValidator { OrderCreationAppData::Full { full } => validate(full)?, }; - if !self.enable_custom_interactions && !app_data.protocol.hooks.is_empty() { - // contains some custom interactions while feature is disabled - return Err(AppDataValidationError::UnsupportedCustomInteraction); - } - let interactions = self.custom_interactions(&app_data.protocol.hooks); Ok(OrderAppData { @@ -1358,7 +1327,6 @@ mod tests { .returning(|_| Ok(0u64)); let validator = OrderValidator { - enable_custom_interactions: true, signature_validator: Arc::new(signature_validator), ..validator }; @@ -1385,7 +1353,6 @@ mod tests { .returning(|_| Err(SignatureValidationError::Invalid)); let validator = OrderValidator { - enable_custom_interactions: true, signature_validator: Arc::new(signature_validator), eip1271_skip_creation_validation: true, ..validator