diff --git a/contracts/src/Gateway.sol b/contracts/src/Gateway.sol index 2d00670fe0..3e5d3e37f1 100644 --- a/contracts/src/Gateway.sol +++ b/contracts/src/Gateway.sol @@ -381,7 +381,6 @@ contract Gateway is IGateway, IInitializable { $.assetHubCreateAssetFee = params.assetHubCreateAssetFee; $.assetHubReserveTransferFee = params.assetHubReserveTransferFee; $.registerTokenFee = params.registerTokenFee; - $.destinationMaxTransferFee = params.destinationMaxTransferFee; emit TokenTransferFeesChanged(); } @@ -632,6 +631,5 @@ contract Gateway is IGateway, IInitializable { assets.registerTokenFee = config.registerTokenFee; assets.assetHubCreateAssetFee = config.assetHubCreateAssetFee; assets.assetHubReserveTransferFee = config.assetHubReserveTransferFee; - assets.destinationMaxTransferFee = config.destinationMaxTransferFee; } } diff --git a/contracts/src/Params.sol b/contracts/src/Params.sol index 7daddfe2ac..fc02989152 100644 --- a/contracts/src/Params.sol +++ b/contracts/src/Params.sol @@ -71,8 +71,6 @@ struct SetTokenTransferFeesParams { uint128 assetHubReserveTransferFee; /// @dev extra fee to register an asset and discourage spamming (Ether) uint256 registerTokenFee; - /// @dev The maximum fee (DOT) that can be sent to a destination parachain during a reserve transfer - uint128 destinationMaxTransferFee; } // Payload for SetPricingParameters diff --git a/contracts/src/upgrades/rococo/GatewayV2.sol b/contracts/src/upgrades/rococo/GatewayV2.sol index 6b7cfdc064..3918e3d790 100644 --- a/contracts/src/upgrades/rococo/GatewayV2.sol +++ b/contracts/src/upgrades/rococo/GatewayV2.sol @@ -6,7 +6,6 @@ import "../../Gateway.sol"; import {UD60x18, convert} from "prb/math/src/UD60x18.sol"; import {PricingStorage} from "../../storage/PricingStorage.sol"; -import {AssetsStorage} from "../../storage/AssetsStorage.sol"; contract GatewayV2 is Gateway { constructor( @@ -24,15 +23,11 @@ contract GatewayV2 is Gateway { } PricingStorage.Layout storage pricing = PricingStorage.layout(); - AssetsStorage.Layout storage assets = AssetsStorage.layout(); - if (pricing.multiplier != convert(0) || assets.destinationMaxTransferFee != 0) { + if (pricing.multiplier != convert(0)) { revert AlreadyInitialized(); } - (UD60x18 multiplier, uint128 maxDestinationFee) = abi.decode(data, (UD60x18, uint128)); - - pricing.multiplier = multiplier; - assets.destinationMaxTransferFee = maxDestinationFee; + pricing.multiplier = abi.decode(data, (UD60x18)); } } diff --git a/contracts/test/Gateway.t.sol b/contracts/test/Gateway.t.sol index 4f61684268..a1c76977a6 100644 --- a/contracts/test/Gateway.t.sol +++ b/contracts/test/Gateway.t.sol @@ -861,25 +861,13 @@ contract GatewayTest is Test { SetTokenTransferFeesParams({ assetHubCreateAssetFee: createTokenFee * 2, registerTokenFee: registerTokenFee, - assetHubReserveTransferFee: sendTokenFee * 3, - destinationMaxTransferFee: maxDestinationFee + 1 + assetHubReserveTransferFee: sendTokenFee * 3 }) ) ); fee = IGateway(address(gateway)).quoteRegisterTokenFee(); // since deliveryCost not changed, so the total fee increased only by 50% assertEq(fee, 7500000000000000); - // register token first - IGateway(address(gateway)).registerToken{value: fee}(address(token)); - - fee = IGateway(address(gateway)).quoteSendTokenFee(address(token), assetHubParaID, 0); - // Fee should increase - assertEq(fee, 10000000000000000); - - ParaID destPara = ParaID.wrap(2043); - fee = IGateway(address(gateway)).quoteSendTokenFee(address(token), destPara, maxDestinationFee + 1); - // Max fee should increase - assertEq(fee, 35000000000250003); } bytes32 public expectChannelIDBytes = bytes32(0xc173fac324158e77fb5840738a1a541f633cbec8884c6a601c567d2b376a0539); @@ -937,7 +925,7 @@ contract GatewayTest is Test { uint256 fee = IGateway(address(gateway)).quoteRegisterTokenFee(); IGateway(address(gateway)).registerToken{value: fee}(address(token)); - uint128 largeFee = 1e11 + 1; // greater than 10 DOT, 10 decimal places + uint128 largeFee = maxDestinationFee + 1; // greater than 10 DOT, 10 decimal places vm.expectRevert(Assets.InvalidDestinationFee.selector); fee = IGateway(address(gateway)).quoteSendTokenFee(address(token), destPara, largeFee); diff --git a/smoketest/src/constants.rs b/smoketest/src/constants.rs index 5a3c57420a..6948caee76 100644 --- a/smoketest/src/constants.rs +++ b/smoketest/src/constants.rs @@ -65,10 +65,6 @@ lazy_static! { .unwrap_or("20000000000".to_string()) .parse() .unwrap(); - pub static ref RESERVE_TRANSFER_MAX_DESTINATION_FEE: u128 = env::var("RESERVE_TRANSFER_MAX_DESTINATION_FEE") - .unwrap_or("10000000000000".to_string()) - .parse() - .unwrap(); pub static ref EXCHANGE_RATE: u128 = env::var("EXCHANGE_RATE") .unwrap_or("2500000000000000".to_string()) .parse() diff --git a/smoketest/tests/set_token_transfer_fees.rs b/smoketest/tests/set_token_transfer_fees.rs index e529a7bba6..bcbb48fb9e 100644 --- a/smoketest/tests/set_token_transfer_fees.rs +++ b/smoketest/tests/set_token_transfer_fees.rs @@ -29,7 +29,6 @@ async fn set_token_transfer_fees() { *CREATE_ASSET_FEE, *RESERVE_TRANSFER_FEE, U256([*REGISTER_TOKEN_FEE, 0, 0, 0]), - *RESERVE_TRANSFER_MAX_DESTINATION_FEE, ) .encode_call_data(&test_clients.bridge_hub_client.metadata()) .expect("encoded call");