diff --git a/pallets/erc20-xcm-bridge/src/erc20_matcher.rs b/pallets/erc20-xcm-bridge/src/erc20_matcher.rs index 6bdb26eeb2..799eabd600 100644 --- a/pallets/erc20-xcm-bridge/src/erc20_matcher.rs +++ b/pallets/erc20-xcm-bridge/src/erc20_matcher.rs @@ -35,8 +35,7 @@ impl> MatchesFungibles }; let contract_address = Self::matches_erc20_multilocation(id) .map_err(|_| MatchError::AssetIdConversionFailed)?; - let amount = - U256::try_from(*amount).map_err(|_| MatchError::AmountToBalanceConversionFailed)?; + let amount = U256::from(*amount); Ok((contract_address, amount)) } @@ -114,6 +113,28 @@ mod tests { ); } + #[test] + fn should_match_valid_erc20_location_with_amount_greater_than_u64() { + let location = MultiLocation { + parents: 0, + interior: Junctions::X2( + PalletInstance(42u8), + AccountKey20 { + key: [0; 20], + network: None, + }, + ), + }; + + assert_ok!( + Erc20Matcher::::matches_fungibles(&MultiAsset::from(( + location, + 100000000000000000u128 + ))), + (H160([0; 20]), U256::from(100000000000000000u128)) + ); + } + #[test] fn should_not_match_invalid_erc20_location() { let invalid_location = MultiLocation { diff --git a/runtime/moonbase/src/xcm_config.rs b/runtime/moonbase/src/xcm_config.rs index 7b611835a4..ce9e794bed 100644 --- a/runtime/moonbase/src/xcm_config.rs +++ b/runtime/moonbase/src/xcm_config.rs @@ -659,7 +659,7 @@ parameter_types! { // To be able to support almost all erc20 implementations, // we provide a sufficiently hight gas limit. - pub Erc20XcmBridgeTransferGasLimit: u64 = 80_000; + pub Erc20XcmBridgeTransferGasLimit: u64 = 200_000; } impl pallet_erc20_xcm_bridge::Config for Runtime { diff --git a/runtime/moonbeam/src/xcm_config.rs b/runtime/moonbeam/src/xcm_config.rs index c710f90a1e..9bf8c2e494 100644 --- a/runtime/moonbeam/src/xcm_config.rs +++ b/runtime/moonbeam/src/xcm_config.rs @@ -649,7 +649,7 @@ parameter_types! { // To be able to support almost all erc20 implementations, // we provide a sufficiently hight gas limit. - pub Erc20XcmBridgeTransferGasLimit: u64 = 80_000; + pub Erc20XcmBridgeTransferGasLimit: u64 = 200_000; } impl pallet_erc20_xcm_bridge::Config for Runtime { diff --git a/runtime/moonriver/src/xcm_config.rs b/runtime/moonriver/src/xcm_config.rs index 7b560343ee..4767b865a3 100644 --- a/runtime/moonriver/src/xcm_config.rs +++ b/runtime/moonriver/src/xcm_config.rs @@ -661,7 +661,7 @@ parameter_types! { // To be able to support almost all erc20 implementations, // we provide a sufficiently hight gas limit. - pub Erc20XcmBridgeTransferGasLimit: u64 = 80_000; + pub Erc20XcmBridgeTransferGasLimit: u64 = 200_000; } impl pallet_erc20_xcm_bridge::Config for Runtime { diff --git a/tests/tests/test-precompile/test-precompile-wormhole.ts b/tests/tests/test-precompile/test-precompile-wormhole.ts index 729edbc0c3..51d1414c18 100644 --- a/tests/tests/test-precompile/test-precompile-wormhole.ts +++ b/tests/tests/test-precompile/test-precompile-wormhole.ts @@ -290,7 +290,7 @@ describeDevMoonbeam(`Test local Wormhole`, (context) => { const result = await context.createBlock( createTransaction(context, { to: PRECOMPILE_GMP_ADDRESS, - gas: 500_000, + gas: 600_000, data, }) );