diff --git a/cumulus/parachains/runtimes/assets/asset-hub-rococo/src/weights/pallet_assets_foreign.rs b/cumulus/parachains/runtimes/assets/asset-hub-rococo/src/weights/pallet_assets_foreign.rs index 8240ca7b0b918..8f817e96f206f 100644 --- a/cumulus/parachains/runtimes/assets/asset-hub-rococo/src/weights/pallet_assets_foreign.rs +++ b/cumulus/parachains/runtimes/assets/asset-hub-rococo/src/weights/pallet_assets_foreign.rs @@ -636,4 +636,32 @@ impl pallet_assets::WeightInfo for WeightInfo { .saturating_add(T::DbWeight::get().reads(1_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } + fn migration_v2_foreign_asset_set_reserve_weight() -> Weight { + // Proof Size summary in bytes: + // Measured: `256` + // Estimated: `0` + // Minimum execution time: 9_596_000 picoseconds. + Weight::from_parts(10_031_000, 0) + } + fn get_name() -> Weight { + // Proof Size summary in bytes: + // Measured: `344` + // Estimated: `0` + // Minimum execution time: 10_390_000 picoseconds. + Weight::from_parts(10_914_000, 0) + } + fn get_symbol() -> Weight { + // Proof Size summary in bytes: + // Measured: `344` + // Estimated: `0` + // Minimum execution time: 10_587_000 picoseconds. + Weight::from_parts(11_121_000, 0) + } + fn get_decimals() -> Weight { + // Proof Size summary in bytes: + // Measured: `344` + // Estimated: `0` + // Minimum execution time: 10_591_000 picoseconds. + Weight::from_parts(11_015_000, 0) + } } diff --git a/cumulus/parachains/runtimes/assets/asset-hub-rococo/src/weights/pallet_assets_local.rs b/cumulus/parachains/runtimes/assets/asset-hub-rococo/src/weights/pallet_assets_local.rs index 4e4cfd96c62e6..a14afce22a881 100644 --- a/cumulus/parachains/runtimes/assets/asset-hub-rococo/src/weights/pallet_assets_local.rs +++ b/cumulus/parachains/runtimes/assets/asset-hub-rococo/src/weights/pallet_assets_local.rs @@ -632,4 +632,32 @@ impl pallet_assets::WeightInfo for WeightInfo { .saturating_add(T::DbWeight::get().reads(1_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } + fn migration_v2_foreign_asset_set_reserve_weight() -> Weight { + // Proof Size summary in bytes: + // Measured: `256` + // Estimated: `0` + // Minimum execution time: 9_596_000 picoseconds. + Weight::from_parts(10_031_000, 0) + } + fn get_name() -> Weight { + // Proof Size summary in bytes: + // Measured: `344` + // Estimated: `0` + // Minimum execution time: 10_390_000 picoseconds. + Weight::from_parts(10_914_000, 0) + } + fn get_symbol() -> Weight { + // Proof Size summary in bytes: + // Measured: `344` + // Estimated: `0` + // Minimum execution time: 10_587_000 picoseconds. + Weight::from_parts(11_121_000, 0) + } + fn get_decimals() -> Weight { + // Proof Size summary in bytes: + // Measured: `344` + // Estimated: `0` + // Minimum execution time: 10_591_000 picoseconds. + Weight::from_parts(11_015_000, 0) + } } diff --git a/cumulus/parachains/runtimes/assets/asset-hub-rococo/src/weights/pallet_assets_pool.rs b/cumulus/parachains/runtimes/assets/asset-hub-rococo/src/weights/pallet_assets_pool.rs index 0b0e9bde4ba82..354831cb497dc 100644 --- a/cumulus/parachains/runtimes/assets/asset-hub-rococo/src/weights/pallet_assets_pool.rs +++ b/cumulus/parachains/runtimes/assets/asset-hub-rococo/src/weights/pallet_assets_pool.rs @@ -626,4 +626,32 @@ impl pallet_assets::WeightInfo for WeightInfo { .saturating_add(T::DbWeight::get().reads(1_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } + fn migration_v2_foreign_asset_set_reserve_weight() -> Weight { + // Proof Size summary in bytes: + // Measured: `256` + // Estimated: `0` + // Minimum execution time: 9_596_000 picoseconds. + Weight::from_parts(10_031_000, 0) + } + fn get_name() -> Weight { + // Proof Size summary in bytes: + // Measured: `344` + // Estimated: `0` + // Minimum execution time: 10_390_000 picoseconds. + Weight::from_parts(10_914_000, 0) + } + fn get_symbol() -> Weight { + // Proof Size summary in bytes: + // Measured: `344` + // Estimated: `0` + // Minimum execution time: 10_587_000 picoseconds. + Weight::from_parts(11_121_000, 0) + } + fn get_decimals() -> Weight { + // Proof Size summary in bytes: + // Measured: `344` + // Estimated: `0` + // Minimum execution time: 10_591_000 picoseconds. + Weight::from_parts(11_015_000, 0) + } } diff --git a/cumulus/parachains/runtimes/assets/asset-hub-westend/src/weights/pallet_assets_foreign.rs b/cumulus/parachains/runtimes/assets/asset-hub-westend/src/weights/pallet_assets_foreign.rs index 0c46c2ccb0fee..7897ceed09ea5 100644 --- a/cumulus/parachains/runtimes/assets/asset-hub-westend/src/weights/pallet_assets_foreign.rs +++ b/cumulus/parachains/runtimes/assets/asset-hub-westend/src/weights/pallet_assets_foreign.rs @@ -656,4 +656,25 @@ impl pallet_assets::WeightInfo for WeightInfo { .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } + fn get_name() -> Weight { + // Proof Size summary in bytes: + // Measured: `344` + // Estimated: `0` + // Minimum execution time: 10_390_000 picoseconds. + Weight::from_parts(10_914_000, 0) + } + fn get_symbol() -> Weight { + // Proof Size summary in bytes: + // Measured: `344` + // Estimated: `0` + // Minimum execution time: 10_587_000 picoseconds. + Weight::from_parts(11_121_000, 0) + } + fn get_decimals() -> Weight { + // Proof Size summary in bytes: + // Measured: `344` + // Estimated: `0` + // Minimum execution time: 10_591_000 picoseconds. + Weight::from_parts(11_015_000, 0) + } } diff --git a/cumulus/parachains/runtimes/assets/asset-hub-westend/src/weights/pallet_assets_local.rs b/cumulus/parachains/runtimes/assets/asset-hub-westend/src/weights/pallet_assets_local.rs index f96d61683d5a5..b4011b74d295a 100644 --- a/cumulus/parachains/runtimes/assets/asset-hub-westend/src/weights/pallet_assets_local.rs +++ b/cumulus/parachains/runtimes/assets/asset-hub-westend/src/weights/pallet_assets_local.rs @@ -656,4 +656,25 @@ impl pallet_assets::WeightInfo for WeightInfo { .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } + fn get_name() -> Weight { + // Proof Size summary in bytes: + // Measured: `344` + // Estimated: `0` + // Minimum execution time: 10_390_000 picoseconds. + Weight::from_parts(10_914_000, 0) + } + fn get_symbol() -> Weight { + // Proof Size summary in bytes: + // Measured: `344` + // Estimated: `0` + // Minimum execution time: 10_587_000 picoseconds. + Weight::from_parts(11_121_000, 0) + } + fn get_decimals() -> Weight { + // Proof Size summary in bytes: + // Measured: `344` + // Estimated: `0` + // Minimum execution time: 10_591_000 picoseconds. + Weight::from_parts(11_015_000, 0) + } } diff --git a/cumulus/parachains/runtimes/assets/asset-hub-westend/src/weights/pallet_assets_pool.rs b/cumulus/parachains/runtimes/assets/asset-hub-westend/src/weights/pallet_assets_pool.rs index 47f2f8e8e5bbd..13aa120c63b3f 100644 --- a/cumulus/parachains/runtimes/assets/asset-hub-westend/src/weights/pallet_assets_pool.rs +++ b/cumulus/parachains/runtimes/assets/asset-hub-westend/src/weights/pallet_assets_pool.rs @@ -648,4 +648,25 @@ impl pallet_assets::WeightInfo for WeightInfo { .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } + fn get_name() -> Weight { + // Proof Size summary in bytes: + // Measured: `344` + // Estimated: `0` + // Minimum execution time: 10_390_000 picoseconds. + Weight::from_parts(10_914_000, 0) + } + fn get_symbol() -> Weight { + // Proof Size summary in bytes: + // Measured: `344` + // Estimated: `0` + // Minimum execution time: 10_587_000 picoseconds. + Weight::from_parts(11_121_000, 0) + } + fn get_decimals() -> Weight { + // Proof Size summary in bytes: + // Measured: `344` + // Estimated: `0` + // Minimum execution time: 10_591_000 picoseconds. + Weight::from_parts(11_015_000, 0) + } } diff --git a/prdoc/pr_10971.prdoc b/prdoc/pr_10971.prdoc new file mode 100644 index 0000000000000..bb1425e5f1827 --- /dev/null +++ b/prdoc/pr_10971.prdoc @@ -0,0 +1,27 @@ +title: "Implement IERC20Metadata for pallet-assets precompiles" + +doc: + - audience: Runtime Dev + description: | + Implements the missing ERC20 metadata functions (`name`, `symbol`, `decimals`) for the + pallet-assets precompile to provide full ERC20 compatibility. These functions are essential + for proper EVM wallet and tooling integration. + + The precompile implementation reads metadata from pallet-assets storage and returns properly + formatted values with appropriate gas charging using dedicated weight functions. All functions + include proper error handling for missing metadata and invalid UTF-8 encoding. + + Benchmarks have been added to measure the weight of metadata reads, and corresponding weight + functions have been implemented in the WeightInfo trait. + + The IERC20.sol interface file has been reorganized to clearly separate and document methods + from the base IERC20 interface and the IERC20Metadata extension, with links to the original + OpenZeppelin contracts for better maintainability. + +crates: + - name: ethereum-standards + bump: minor + - name: pallet-assets-precompiles + bump: minor + - name: pallet-assets + bump: minor diff --git a/substrate/frame/assets/precompiles/src/lib.rs b/substrate/frame/assets/precompiles/src/lib.rs index 19b24a4db3f08..509aed913f771 100644 --- a/substrate/frame/assets/precompiles/src/lib.rs +++ b/substrate/frame/assets/precompiles/src/lib.rs @@ -118,6 +118,9 @@ where IERC20Calls::allowance(call) => Self::allowance(asset_id, call, env), IERC20Calls::approve(call) => Self::approve(asset_id, call, env), IERC20Calls::transferFrom(call) => Self::transfer_from(asset_id, call, env), + IERC20Calls::name(_) => Self::name(asset_id, env), + IERC20Calls::symbol(_) => Self::symbol(asset_id, env), + IERC20Calls::decimals(_) => Self::decimals(asset_id, env), } } } @@ -322,4 +325,49 @@ where return Ok(IERC20::transferFromCall::abi_encode_returns(&true)); } + + /// Execute the name call. + fn name( + asset_id: >::AssetId, + env: &mut impl Ext, + ) -> Result, Error> { + env.charge(>::WeightInfo::get_name())?; + + let metadata = pallet_assets::Pallet::::get_metadata(asset_id) + .ok_or(Error::Revert(Revert { reason: "Metadata not found".into() }))?; + + let name = alloc::string::String::from_utf8(metadata.name.to_vec()) + .map_err(|_| Error::Revert(Revert { reason: "Invalid UTF-8 in name".into() }))?; + + Ok(IERC20::nameCall::abi_encode_returns(&name)) + } + + /// Execute the symbol call. + fn symbol( + asset_id: >::AssetId, + env: &mut impl Ext, + ) -> Result, Error> { + env.charge(>::WeightInfo::get_symbol())?; + + let metadata = pallet_assets::Pallet::::get_metadata(asset_id) + .ok_or(Error::Revert(Revert { reason: "Metadata not found".into() }))?; + + let symbol = alloc::string::String::from_utf8(metadata.symbol.to_vec()) + .map_err(|_| Error::Revert(Revert { reason: "Invalid UTF-8 in symbol".into() }))?; + + Ok(IERC20::symbolCall::abi_encode_returns(&symbol)) + } + + /// Execute the decimals call. + fn decimals( + asset_id: >::AssetId, + env: &mut impl Ext, + ) -> Result, Error> { + env.charge(>::WeightInfo::get_decimals())?; + + let metadata = pallet_assets::Pallet::::get_metadata(asset_id) + .ok_or(Error::Revert(Revert { reason: "Metadata not found".into() }))?; + + Ok(IERC20::decimalsCall::abi_encode_returns(&metadata.decimals)) + } } diff --git a/substrate/frame/assets/src/benchmarking.rs b/substrate/frame/assets/src/benchmarking.rs index 39959039775e7..054f4696eb1d6 100644 --- a/substrate/frame/assets/src/benchmarking.rs +++ b/substrate/frame/assets/src/benchmarking.rs @@ -641,5 +641,50 @@ benchmarks_instance_pallet! { assert_eq!(Reserves::::get(id)[0], reserve); } + get_name { + let (asset_id, caller, _) = create_default_asset::(true); + T::Currency::make_free_balance_be(&caller, DepositBalanceOf::::max_value()); + let name_bytes = vec![0u8; T::StringLimit::get() as usize]; + let symbol_bytes = vec![0u8; T::StringLimit::get() as usize]; + let origin = SystemOrigin::Signed(caller).into(); + Assets::::set_metadata(origin, asset_id.clone(), name_bytes.clone(), symbol_bytes, 12)?; + }: { + let _ = Pallet::::get_metadata(asset_id.clone().into()); + } verify { + let metadata = Pallet::::get_metadata(asset_id.into()); + assert!(metadata.is_some()); + assert_eq!(metadata.unwrap().name.to_vec(), name_bytes); + } + + get_symbol { + let (asset_id, caller, _) = create_default_asset::(true); + T::Currency::make_free_balance_be(&caller, DepositBalanceOf::::max_value()); + let name_bytes = vec![0u8; T::StringLimit::get() as usize]; + let symbol_bytes = vec![0u8; T::StringLimit::get() as usize]; + let origin = SystemOrigin::Signed(caller).into(); + Assets::::set_metadata(origin, asset_id.clone(), name_bytes, symbol_bytes.clone(), 12)?; + }: { + let _ = Pallet::::get_metadata(asset_id.clone().into()); + } verify { + let metadata = Pallet::::get_metadata(asset_id.into()); + assert!(metadata.is_some()); + assert_eq!(metadata.unwrap().symbol.to_vec(), symbol_bytes); + } + + get_decimals { + let (asset_id, caller, _) = create_default_asset::(true); + T::Currency::make_free_balance_be(&caller, DepositBalanceOf::::max_value()); + let name_bytes = vec![0u8; T::StringLimit::get() as usize]; + let symbol_bytes = vec![0u8; T::StringLimit::get() as usize]; + let origin = SystemOrigin::Signed(caller).into(); + Assets::::set_metadata(origin, asset_id.clone(), name_bytes, symbol_bytes, 12)?; + }: { + let _ = Pallet::::get_metadata(asset_id.clone().into()); + } verify { + let metadata = Pallet::::get_metadata(asset_id.into()); + assert!(metadata.is_some()); + assert_eq!(metadata.unwrap().decimals, 12); + } + impl_benchmark_test_suite!(Assets, crate::mock::new_test_ext(), crate::mock::Test) } diff --git a/substrate/frame/assets/src/weights.rs b/substrate/frame/assets/src/weights.rs index 13c37ca5115f9..43307873a2bfe 100644 --- a/substrate/frame/assets/src/weights.rs +++ b/substrate/frame/assets/src/weights.rs @@ -35,9 +35,9 @@ //! Autogenerated weights for `pallet_assets` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 32.0.0 -//! DATE: 2025-05-18, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2026-02-03, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `c47a012f15ca`, CPU: `Intel(R) Xeon(R) CPU @ 2.60GHz` +//! HOSTNAME: `b21f801dcd0f`, CPU: `Intel(R) Xeon(R) CPU @ 2.60GHz` //! WASM-EXECUTION: `Compiled`, CHAIN: `None`, DB CACHE: `1024` // Executed Command: @@ -74,8 +74,8 @@ pub trait WeightInfo { fn create() -> Weight; fn force_create() -> Weight; fn start_destroy() -> Weight; - fn destroy_accounts(c: u32) -> Weight; - fn destroy_approvals(a: u32) -> Weight; + fn destroy_accounts(c: u32, ) -> Weight; + fn destroy_approvals(a: u32, ) -> Weight; fn finish_destroy() -> Weight; fn mint() -> Weight; fn burn() -> Weight; @@ -88,9 +88,10 @@ pub trait WeightInfo { fn thaw_asset() -> Weight; fn transfer_ownership() -> Weight; fn set_team() -> Weight; - fn set_metadata(n: u32, s: u32) -> Weight; + fn set_reserves(n: u32, ) -> Weight; + fn set_metadata(n: u32, s: u32, ) -> Weight; fn clear_metadata() -> Weight; - fn force_set_metadata(n: u32, s: u32) -> Weight; + fn force_set_metadata(n: u32, s: u32, ) -> Weight; fn force_clear_metadata() -> Weight; fn force_asset_status() -> Weight; fn approve_transfer() -> Weight; @@ -107,1017 +108,633 @@ pub trait WeightInfo { fn total_issuance() -> Weight; fn balance() -> Weight; fn allowance() -> Weight; - fn set_reserves(n: u32) -> Weight; - fn migration_v2_foreign_asset_set_reserve_weight() -> Weight { - // disabled by default, force explicit benchmarking - Weight::MAX - } + fn migration_v2_foreign_asset_set_reserve_weight() -> Weight; + fn get_name() -> Weight; + fn get_symbol() -> Weight; + fn get_decimals() -> Weight; } /// Weights for `pallet_assets` using the Substrate node and recommended hardware. pub struct SubstrateWeight(PhantomData); - impl WeightInfo for SubstrateWeight { - /// Storage: `Assets::Asset` (r:1 w:1) - /// Proof: `Assets::Asset` (`max_values`: None, `max_size`: Some(210), added: 2685, mode: `MaxEncodedLen`) - /// Storage: `Assets::NextAssetId` (r:1 w:0) - /// Proof: `Assets::NextAssetId` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) - /// Storage: `System::Account` (r:1 w:1) - /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) fn create() -> Weight { // Proof Size summary in bytes: - // Measured: `326` - // Estimated: `3675` - // Minimum execution time: 30_517_000 picoseconds. - Weight::from_parts(31_518_000, 3675) - .saturating_add(T::DbWeight::get().reads(3_u64)) - .saturating_add(T::DbWeight::get().writes(2_u64)) - } - /// Storage: `Assets::Asset` (r:1 w:1) - /// Proof: `Assets::Asset` (`max_values`: None, `max_size`: Some(210), added: 2685, mode: `MaxEncodedLen`) - /// Storage: `Assets::NextAssetId` (r:1 w:0) - /// Proof: `Assets::NextAssetId` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) + // Measured: `359` + // Estimated: `0` + // Minimum execution time: 37_906_000 picoseconds. + Weight::from_parts(39_021_000, 0) + } fn force_create() -> Weight { // Proof Size summary in bytes: - // Measured: `186` - // Estimated: `3675` - // Minimum execution time: 12_469_000 picoseconds. - Weight::from_parts(13_002_000, 3675) - .saturating_add(T::DbWeight::get().reads(2_u64)) - .saturating_add(T::DbWeight::get().writes(1_u64)) + // Measured: `219` + // Estimated: `0` + // Minimum execution time: 15_275_000 picoseconds. + Weight::from_parts(16_190_000, 0) } - /// Storage: `Assets::Asset` (r:1 w:1) - /// Proof: `Assets::Asset` (`max_values`: None, `max_size`: Some(210), added: 2685, mode: `MaxEncodedLen`) fn start_destroy() -> Weight { // Proof Size summary in bytes: - // Measured: `418` - // Estimated: `3675` - // Minimum execution time: 14_767_000 picoseconds. - Weight::from_parts(15_425_000, 3675) - .saturating_add(T::DbWeight::get().reads(1_u64)) - .saturating_add(T::DbWeight::get().writes(1_u64)) - } - /// Storage: `Assets::Asset` (r:1 w:1) - /// Proof: `Assets::Asset` (`max_values`: None, `max_size`: Some(210), added: 2685, mode: `MaxEncodedLen`) - /// Storage: `Assets::Account` (r:1001 w:1000) - /// Proof: `Assets::Account` (`max_values`: None, `max_size`: Some(134), added: 2609, mode: `MaxEncodedLen`) - /// Storage: `System::Account` (r:1000 w:1000) - /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) + // Measured: `451` + // Estimated: `0` + // Minimum execution time: 18_715_000 picoseconds. + Weight::from_parts(19_343_000, 0) + } /// The range of component `c` is `[0, 1000]`. - fn destroy_accounts(c: u32) -> Weight { - // Proof Size summary in bytes: - // Measured: `104 + c * (208 ±0)` - // Estimated: `3675 + c * (2609 ±0)` - // Minimum execution time: 18_900_000 picoseconds. - Weight::from_parts(19_222_000, 3675) - // Standard Error: 25_984 - .saturating_add(Weight::from_parts(15_436_025, 0).saturating_mul(c.into())) - .saturating_add(T::DbWeight::get().reads(2_u64)) - .saturating_add(T::DbWeight::get().reads((2_u64).saturating_mul(c.into()))) - .saturating_add(T::DbWeight::get().writes(1_u64)) - .saturating_add(T::DbWeight::get().writes((2_u64).saturating_mul(c.into()))) - .saturating_add(Weight::from_parts(0, 2609).saturating_mul(c.into())) - } - /// Storage: `Assets::Asset` (r:1 w:1) - /// Proof: `Assets::Asset` (`max_values`: None, `max_size`: Some(210), added: 2685, mode: `MaxEncodedLen`) - /// Storage: `Assets::Approvals` (r:1001 w:1000) - /// Proof: `Assets::Approvals` (`max_values`: None, `max_size`: Some(148), added: 2623, mode: `MaxEncodedLen`) + fn destroy_accounts(c: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `169 + c * (208 ±0)` + // Estimated: `0` + // Minimum execution time: 23_225_000 picoseconds. + Weight::from_parts(24_036_000, 0) + // Standard Error: 16_243 + .saturating_add(Weight::from_parts(16_075_928, 0).saturating_mul(c.into())) + } /// The range of component `a` is `[0, 1000]`. - fn destroy_approvals(a: u32) -> Weight { - // Proof Size summary in bytes: - // Measured: `555 + a * (86 ±0)` - // Estimated: `3675 + a * (2623 ±0)` - // Minimum execution time: 19_685_000 picoseconds. - Weight::from_parts(20_138_000, 3675) - // Standard Error: 10_401 - .saturating_add(Weight::from_parts(15_779_729, 0).saturating_mul(a.into())) - .saturating_add(T::DbWeight::get().reads(2_u64)) - .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(a.into()))) - .saturating_add(T::DbWeight::get().writes(1_u64)) - .saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(a.into()))) - .saturating_add(Weight::from_parts(0, 2623).saturating_mul(a.into())) - } - /// Storage: `Assets::Asset` (r:1 w:1) - /// Proof: `Assets::Asset` (`max_values`: None, `max_size`: Some(210), added: 2685, mode: `MaxEncodedLen`) - /// Storage: `Assets::Metadata` (r:1 w:0) - /// Proof: `Assets::Metadata` (`max_values`: None, `max_size`: Some(140), added: 2615, mode: `MaxEncodedLen`) + fn destroy_approvals(a: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `588 + a * (86 ±0)` + // Estimated: `0` + // Minimum execution time: 24_564_000 picoseconds. + Weight::from_parts(25_003_000, 0) + // Standard Error: 19_112 + .saturating_add(Weight::from_parts(18_423_272, 0).saturating_mul(a.into())) + } fn finish_destroy() -> Weight { // Proof Size summary in bytes: - // Measured: `384` - // Estimated: `3675` - // Minimum execution time: 15_652_000 picoseconds. - Weight::from_parts(16_159_000, 3675) - .saturating_add(T::DbWeight::get().reads(2_u64)) - .saturating_add(T::DbWeight::get().writes(1_u64)) - } - /// Storage: `Assets::Asset` (r:1 w:1) - /// Proof: `Assets::Asset` (`max_values`: None, `max_size`: Some(210), added: 2685, mode: `MaxEncodedLen`) - /// Storage: `Assets::Account` (r:1 w:1) - /// Proof: `Assets::Account` (`max_values`: None, `max_size`: Some(134), added: 2609, mode: `MaxEncodedLen`) + // Measured: `417` + // Estimated: `0` + // Minimum execution time: 20_991_000 picoseconds. + Weight::from_parts(22_192_000, 0) + } fn mint() -> Weight { // Proof Size summary in bytes: - // Measured: `384` - // Estimated: `3675` - // Minimum execution time: 25_446_000 picoseconds. - Weight::from_parts(26_623_000, 3675) - .saturating_add(T::DbWeight::get().reads(2_u64)) - .saturating_add(T::DbWeight::get().writes(2_u64)) - } - /// Storage: `Assets::Asset` (r:1 w:1) - /// Proof: `Assets::Asset` (`max_values`: None, `max_size`: Some(210), added: 2685, mode: `MaxEncodedLen`) - /// Storage: `Assets::Account` (r:1 w:1) - /// Proof: `Assets::Account` (`max_values`: None, `max_size`: Some(134), added: 2609, mode: `MaxEncodedLen`) + // Measured: `417` + // Estimated: `0` + // Minimum execution time: 31_488_000 picoseconds. + Weight::from_parts(33_018_000, 0) + } fn burn() -> Weight { // Proof Size summary in bytes: - // Measured: `492` - // Estimated: `3675` - // Minimum execution time: 33_608_000 picoseconds. - Weight::from_parts(34_662_000, 3675) - .saturating_add(T::DbWeight::get().reads(2_u64)) - .saturating_add(T::DbWeight::get().writes(2_u64)) - } - /// Storage: `Assets::Asset` (r:1 w:1) - /// Proof: `Assets::Asset` (`max_values`: None, `max_size`: Some(210), added: 2685, mode: `MaxEncodedLen`) - /// Storage: `Assets::Account` (r:2 w:2) - /// Proof: `Assets::Account` (`max_values`: None, `max_size`: Some(134), added: 2609, mode: `MaxEncodedLen`) - /// Storage: `System::Account` (r:1 w:1) - /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) + // Measured: `525` + // Estimated: `0` + // Minimum execution time: 40_473_000 picoseconds. + Weight::from_parts(42_186_000, 0) + } fn transfer() -> Weight { // Proof Size summary in bytes: - // Measured: `531` - // Estimated: `6208` - // Minimum execution time: 46_426_000 picoseconds. - Weight::from_parts(47_772_000, 6208) - .saturating_add(T::DbWeight::get().reads(4_u64)) - .saturating_add(T::DbWeight::get().writes(4_u64)) - } - /// Storage: `Assets::Asset` (r:1 w:1) - /// Proof: `Assets::Asset` (`max_values`: None, `max_size`: Some(210), added: 2685, mode: `MaxEncodedLen`) - /// Storage: `Assets::Account` (r:2 w:2) - /// Proof: `Assets::Account` (`max_values`: None, `max_size`: Some(134), added: 2609, mode: `MaxEncodedLen`) - /// Storage: `System::Account` (r:1 w:1) - /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) + // Measured: `564` + // Estimated: `0` + // Minimum execution time: 56_280_000 picoseconds. + Weight::from_parts(58_051_000, 0) + } fn transfer_keep_alive() -> Weight { // Proof Size summary in bytes: - // Measured: `531` - // Estimated: `6208` - // Minimum execution time: 42_162_000 picoseconds. - Weight::from_parts(42_964_000, 6208) - .saturating_add(T::DbWeight::get().reads(4_u64)) - .saturating_add(T::DbWeight::get().writes(4_u64)) - } - /// Storage: `Assets::Asset` (r:1 w:1) - /// Proof: `Assets::Asset` (`max_values`: None, `max_size`: Some(210), added: 2685, mode: `MaxEncodedLen`) - /// Storage: `Assets::Account` (r:2 w:2) - /// Proof: `Assets::Account` (`max_values`: None, `max_size`: Some(134), added: 2609, mode: `MaxEncodedLen`) - /// Storage: `System::Account` (r:1 w:1) - /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) + // Measured: `564` + // Estimated: `0` + // Minimum execution time: 51_241_000 picoseconds. + Weight::from_parts(52_867_000, 0) + } fn force_transfer() -> Weight { // Proof Size summary in bytes: - // Measured: `531` - // Estimated: `6208` - // Minimum execution time: 46_399_000 picoseconds. - Weight::from_parts(47_580_000, 6208) - .saturating_add(T::DbWeight::get().reads(4_u64)) - .saturating_add(T::DbWeight::get().writes(4_u64)) - } - /// Storage: `Assets::Asset` (r:1 w:0) - /// Proof: `Assets::Asset` (`max_values`: None, `max_size`: Some(210), added: 2685, mode: `MaxEncodedLen`) - /// Storage: `Assets::Account` (r:1 w:1) - /// Proof: `Assets::Account` (`max_values`: None, `max_size`: Some(134), added: 2609, mode: `MaxEncodedLen`) + // Measured: `564` + // Estimated: `0` + // Minimum execution time: 55_379_000 picoseconds. + Weight::from_parts(57_682_000, 0) + } fn freeze() -> Weight { // Proof Size summary in bytes: - // Measured: `492` - // Estimated: `3675` - // Minimum execution time: 19_369_000 picoseconds. - Weight::from_parts(19_799_000, 3675) - .saturating_add(T::DbWeight::get().reads(2_u64)) - .saturating_add(T::DbWeight::get().writes(1_u64)) - } - /// Storage: `Assets::Asset` (r:1 w:0) - /// Proof: `Assets::Asset` (`max_values`: None, `max_size`: Some(210), added: 2685, mode: `MaxEncodedLen`) - /// Storage: `Assets::Account` (r:1 w:1) - /// Proof: `Assets::Account` (`max_values`: None, `max_size`: Some(134), added: 2609, mode: `MaxEncodedLen`) + // Measured: `525` + // Estimated: `0` + // Minimum execution time: 23_803_000 picoseconds. + Weight::from_parts(24_599_000, 0) + } fn thaw() -> Weight { // Proof Size summary in bytes: - // Measured: `492` - // Estimated: `3675` - // Minimum execution time: 19_145_000 picoseconds. - Weight::from_parts(19_873_000, 3675) - .saturating_add(T::DbWeight::get().reads(2_u64)) - .saturating_add(T::DbWeight::get().writes(1_u64)) + // Measured: `525` + // Estimated: `0` + // Minimum execution time: 23_390_000 picoseconds. + Weight::from_parts(24_391_000, 0) } - /// Storage: `Assets::Asset` (r:1 w:1) - /// Proof: `Assets::Asset` (`max_values`: None, `max_size`: Some(210), added: 2685, mode: `MaxEncodedLen`) fn freeze_asset() -> Weight { // Proof Size summary in bytes: - // Measured: `418` - // Estimated: `3675` - // Minimum execution time: 14_728_000 picoseconds. - Weight::from_parts(15_405_000, 3675) - .saturating_add(T::DbWeight::get().reads(1_u64)) - .saturating_add(T::DbWeight::get().writes(1_u64)) + // Measured: `451` + // Estimated: `0` + // Minimum execution time: 18_154_000 picoseconds. + Weight::from_parts(18_948_000, 0) } - /// Storage: `Assets::Asset` (r:1 w:1) - /// Proof: `Assets::Asset` (`max_values`: None, `max_size`: Some(210), added: 2685, mode: `MaxEncodedLen`) fn thaw_asset() -> Weight { // Proof Size summary in bytes: - // Measured: `418` - // Estimated: `3675` - // Minimum execution time: 14_730_000 picoseconds. - Weight::from_parts(15_284_000, 3675) - .saturating_add(T::DbWeight::get().reads(1_u64)) - .saturating_add(T::DbWeight::get().writes(1_u64)) - } - /// Storage: `Assets::Asset` (r:1 w:1) - /// Proof: `Assets::Asset` (`max_values`: None, `max_size`: Some(210), added: 2685, mode: `MaxEncodedLen`) - /// Storage: `Assets::Metadata` (r:1 w:0) - /// Proof: `Assets::Metadata` (`max_values`: None, `max_size`: Some(140), added: 2615, mode: `MaxEncodedLen`) + // Measured: `451` + // Estimated: `0` + // Minimum execution time: 18_529_000 picoseconds. + Weight::from_parts(19_122_000, 0) + } fn transfer_ownership() -> Weight { // Proof Size summary in bytes: - // Measured: `384` - // Estimated: `3675` - // Minimum execution time: 16_247_000 picoseconds. - Weight::from_parts(16_890_000, 3675) - .saturating_add(T::DbWeight::get().reads(2_u64)) - .saturating_add(T::DbWeight::get().writes(1_u64)) + // Measured: `417` + // Estimated: `0` + // Minimum execution time: 19_860_000 picoseconds. + Weight::from_parts(20_868_000, 0) } - /// Storage: `Assets::Asset` (r:1 w:1) - /// Proof: `Assets::Asset` (`max_values`: None, `max_size`: Some(210), added: 2685, mode: `MaxEncodedLen`) fn set_team() -> Weight { // Proof Size summary in bytes: - // Measured: `384` - // Estimated: `3675` - // Minimum execution time: 14_206_000 picoseconds. - Weight::from_parts(14_856_000, 3675) - .saturating_add(T::DbWeight::get().reads(1_u64)) - .saturating_add(T::DbWeight::get().writes(1_u64)) - } - /// Storage: `Assets::Asset` (r:1 w:0) - /// Proof: `Assets::Asset` (`max_values`: None, `max_size`: Some(210), added: 2685, mode: `MaxEncodedLen`) - /// Storage: `Assets::Metadata` (r:1 w:1) - /// Proof: `Assets::Metadata` (`max_values`: None, `max_size`: Some(140), added: 2615, mode: `MaxEncodedLen`) + // Measured: `417` + // Estimated: `0` + // Minimum execution time: 17_895_000 picoseconds. + Weight::from_parts(18_788_000, 0) + } + /// The range of component `n` is `[0, 5]`. + fn set_reserves(n: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `417` + // Estimated: `0` + // Minimum execution time: 19_036_000 picoseconds. + Weight::from_parts(20_416_156, 0) + // Standard Error: 8_444 + .saturating_add(Weight::from_parts(86_263, 0).saturating_mul(n.into())) + } /// The range of component `n` is `[0, 50]`. /// The range of component `s` is `[0, 50]`. - fn set_metadata(_n: u32, s: u32) -> Weight { - // Proof Size summary in bytes: - // Measured: `384` - // Estimated: `3675` - // Minimum execution time: 30_217_000 picoseconds. - Weight::from_parts(31_869_256, 3675) - // Standard Error: 1_165 - .saturating_add(Weight::from_parts(826, 0).saturating_mul(s.into())) - .saturating_add(T::DbWeight::get().reads(2_u64)) - .saturating_add(T::DbWeight::get().writes(1_u64)) - } - /// Storage: `Assets::Asset` (r:1 w:0) - /// Proof: `Assets::Asset` (`max_values`: None, `max_size`: Some(210), added: 2685, mode: `MaxEncodedLen`) - /// Storage: `Assets::Metadata` (r:1 w:1) - /// Proof: `Assets::Metadata` (`max_values`: None, `max_size`: Some(140), added: 2615, mode: `MaxEncodedLen`) + fn set_metadata(n: u32, s: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `417` + // Estimated: `0` + // Minimum execution time: 37_385_000 picoseconds. + Weight::from_parts(39_399_235, 0) + // Standard Error: 2_083 + .saturating_add(Weight::from_parts(6_204, 0).saturating_mul(n.into())) + // Standard Error: 2_083 + .saturating_add(Weight::from_parts(4_848, 0).saturating_mul(s.into())) + } fn clear_metadata() -> Weight { // Proof Size summary in bytes: - // Measured: `548` - // Estimated: `3675` - // Minimum execution time: 29_914_000 picoseconds. - Weight::from_parts(30_680_000, 3675) - .saturating_add(T::DbWeight::get().reads(2_u64)) - .saturating_add(T::DbWeight::get().writes(1_u64)) - } - /// Storage: `Assets::Asset` (r:1 w:0) - /// Proof: `Assets::Asset` (`max_values`: None, `max_size`: Some(210), added: 2685, mode: `MaxEncodedLen`) - /// Storage: `Assets::Metadata` (r:1 w:1) - /// Proof: `Assets::Metadata` (`max_values`: None, `max_size`: Some(140), added: 2615, mode: `MaxEncodedLen`) + // Measured: `581` + // Estimated: `0` + // Minimum execution time: 37_347_000 picoseconds. + Weight::from_parts(38_771_000, 0) + } /// The range of component `n` is `[0, 50]`. /// The range of component `s` is `[0, 50]`. - fn force_set_metadata(n: u32, s: u32) -> Weight { - // Proof Size summary in bytes: - // Measured: `223` - // Estimated: `3675` - // Minimum execution time: 13_045_000 picoseconds. - Weight::from_parts(13_680_991, 3675) - // Standard Error: 528 - .saturating_add(Weight::from_parts(3_162, 0).saturating_mul(n.into())) - // Standard Error: 528 - .saturating_add(Weight::from_parts(2_931, 0).saturating_mul(s.into())) - .saturating_add(T::DbWeight::get().reads(2_u64)) - .saturating_add(T::DbWeight::get().writes(1_u64)) - } - /// Storage: `Assets::Asset` (r:1 w:0) - /// Proof: `Assets::Asset` (`max_values`: None, `max_size`: Some(210), added: 2685, mode: `MaxEncodedLen`) - /// Storage: `Assets::Metadata` (r:1 w:1) - /// Proof: `Assets::Metadata` (`max_values`: None, `max_size`: Some(140), added: 2615, mode: `MaxEncodedLen`) + fn force_set_metadata(n: u32, s: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `256` + // Estimated: `0` + // Minimum execution time: 15_827_000 picoseconds. + Weight::from_parts(17_156_574, 0) + // Standard Error: 698 + .saturating_add(Weight::from_parts(72, 0).saturating_mul(n.into())) + // Standard Error: 698 + .saturating_add(Weight::from_parts(1_802, 0).saturating_mul(s.into())) + } fn force_clear_metadata() -> Weight { // Proof Size summary in bytes: - // Measured: `548` - // Estimated: `3675` - // Minimum execution time: 29_440_000 picoseconds. - Weight::from_parts(30_302_000, 3675) - .saturating_add(T::DbWeight::get().reads(2_u64)) - .saturating_add(T::DbWeight::get().writes(1_u64)) + // Measured: `581` + // Estimated: `0` + // Minimum execution time: 36_270_000 picoseconds. + Weight::from_parts(37_551_000, 0) } - /// Storage: `Assets::Asset` (r:1 w:1) - /// Proof: `Assets::Asset` (`max_values`: None, `max_size`: Some(210), added: 2685, mode: `MaxEncodedLen`) fn force_asset_status() -> Weight { // Proof Size summary in bytes: - // Measured: `384` - // Estimated: `3675` - // Minimum execution time: 14_175_000 picoseconds. - Weight::from_parts(14_802_000, 3675) - .saturating_add(T::DbWeight::get().reads(1_u64)) - .saturating_add(T::DbWeight::get().writes(1_u64)) - } - /// Storage: `Assets::Asset` (r:1 w:1) - /// Proof: `Assets::Asset` (`max_values`: None, `max_size`: Some(210), added: 2685, mode: `MaxEncodedLen`) - /// Storage: `Assets::Approvals` (r:1 w:1) - /// Proof: `Assets::Approvals` (`max_values`: None, `max_size`: Some(148), added: 2623, mode: `MaxEncodedLen`) + // Measured: `417` + // Estimated: `0` + // Minimum execution time: 17_570_000 picoseconds. + Weight::from_parts(18_289_000, 0) + } fn approve_transfer() -> Weight { // Proof Size summary in bytes: - // Measured: `418` - // Estimated: `3675` - // Minimum execution time: 34_027_000 picoseconds. - Weight::from_parts(34_976_000, 3675) - .saturating_add(T::DbWeight::get().reads(2_u64)) - .saturating_add(T::DbWeight::get().writes(2_u64)) - } - /// Storage: `Assets::Asset` (r:1 w:1) - /// Proof: `Assets::Asset` (`max_values`: None, `max_size`: Some(210), added: 2685, mode: `MaxEncodedLen`) - /// Storage: `Assets::Approvals` (r:1 w:1) - /// Proof: `Assets::Approvals` (`max_values`: None, `max_size`: Some(148), added: 2623, mode: `MaxEncodedLen`) - /// Storage: `Assets::Account` (r:2 w:2) - /// Proof: `Assets::Account` (`max_values`: None, `max_size`: Some(134), added: 2609, mode: `MaxEncodedLen`) - /// Storage: `System::Account` (r:1 w:1) - /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) + // Measured: `451` + // Estimated: `0` + // Minimum execution time: 42_667_000 picoseconds. + Weight::from_parts(44_135_000, 0) + } fn transfer_approved() -> Weight { // Proof Size summary in bytes: - // Measured: `701` - // Estimated: `6208` - // Minimum execution time: 66_073_000 picoseconds. - Weight::from_parts(69_478_000, 6208) - .saturating_add(T::DbWeight::get().reads(5_u64)) - .saturating_add(T::DbWeight::get().writes(5_u64)) - } - /// Storage: `Assets::Asset` (r:1 w:1) - /// Proof: `Assets::Asset` (`max_values`: None, `max_size`: Some(210), added: 2685, mode: `MaxEncodedLen`) - /// Storage: `Assets::Approvals` (r:1 w:1) - /// Proof: `Assets::Approvals` (`max_values`: None, `max_size`: Some(148), added: 2623, mode: `MaxEncodedLen`) + // Measured: `734` + // Estimated: `0` + // Minimum execution time: 80_961_000 picoseconds. + Weight::from_parts(83_202_000, 0) + } fn cancel_approval() -> Weight { // Proof Size summary in bytes: - // Measured: `588` - // Estimated: `3675` - // Minimum execution time: 35_452_000 picoseconds. - Weight::from_parts(36_883_000, 3675) - .saturating_add(T::DbWeight::get().reads(2_u64)) - .saturating_add(T::DbWeight::get().writes(2_u64)) - } - /// Storage: `Assets::Asset` (r:1 w:1) - /// Proof: `Assets::Asset` (`max_values`: None, `max_size`: Some(210), added: 2685, mode: `MaxEncodedLen`) - /// Storage: `Assets::Approvals` (r:1 w:1) - /// Proof: `Assets::Approvals` (`max_values`: None, `max_size`: Some(148), added: 2623, mode: `MaxEncodedLen`) + // Measured: `621` + // Estimated: `0` + // Minimum execution time: 44_631_000 picoseconds. + Weight::from_parts(45_692_000, 0) + } fn force_cancel_approval() -> Weight { // Proof Size summary in bytes: - // Measured: `588` - // Estimated: `3675` - // Minimum execution time: 35_154_000 picoseconds. - Weight::from_parts(36_578_000, 3675) - .saturating_add(T::DbWeight::get().reads(2_u64)) - .saturating_add(T::DbWeight::get().writes(2_u64)) + // Measured: `621` + // Estimated: `0` + // Minimum execution time: 43_978_000 picoseconds. + Weight::from_parts(45_190_000, 0) } - /// Storage: `Assets::Asset` (r:1 w:1) - /// Proof: `Assets::Asset` (`max_values`: None, `max_size`: Some(210), added: 2685, mode: `MaxEncodedLen`) fn set_min_balance() -> Weight { // Proof Size summary in bytes: - // Measured: `384` - // Estimated: `3675` - // Minimum execution time: 14_904_000 picoseconds. - Weight::from_parts(15_505_000, 3675) - .saturating_add(T::DbWeight::get().reads(1_u64)) - .saturating_add(T::DbWeight::get().writes(1_u64)) - } - /// Storage: `Assets::Account` (r:1 w:1) - /// Proof: `Assets::Account` (`max_values`: None, `max_size`: Some(134), added: 2609, mode: `MaxEncodedLen`) - /// Storage: `Assets::Asset` (r:1 w:1) - /// Proof: `Assets::Asset` (`max_values`: None, `max_size`: Some(210), added: 2685, mode: `MaxEncodedLen`) - /// Storage: `System::Account` (r:1 w:1) - /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) + // Measured: `417` + // Estimated: `0` + // Minimum execution time: 18_750_000 picoseconds. + Weight::from_parts(19_531_000, 0) + } fn touch() -> Weight { // Proof Size summary in bytes: - // Measured: `486` - // Estimated: `3675` - // Minimum execution time: 35_434_000 picoseconds. - Weight::from_parts(36_636_000, 3675) - .saturating_add(T::DbWeight::get().reads(3_u64)) - .saturating_add(T::DbWeight::get().writes(3_u64)) - } - /// Storage: `Assets::Account` (r:1 w:1) - /// Proof: `Assets::Account` (`max_values`: None, `max_size`: Some(134), added: 2609, mode: `MaxEncodedLen`) - /// Storage: `Assets::Asset` (r:1 w:1) - /// Proof: `Assets::Asset` (`max_values`: None, `max_size`: Some(210), added: 2685, mode: `MaxEncodedLen`) + // Measured: `519` + // Estimated: `0` + // Minimum execution time: 44_307_000 picoseconds. + Weight::from_parts(45_710_000, 0) + } fn touch_other() -> Weight { // Proof Size summary in bytes: - // Measured: `384` - // Estimated: `3675` - // Minimum execution time: 33_361_000 picoseconds. - Weight::from_parts(34_522_000, 3675) - .saturating_add(T::DbWeight::get().reads(2_u64)) - .saturating_add(T::DbWeight::get().writes(2_u64)) - } - /// Storage: `Assets::Account` (r:1 w:1) - /// Proof: `Assets::Account` (`max_values`: None, `max_size`: Some(134), added: 2609, mode: `MaxEncodedLen`) - /// Storage: `Assets::Asset` (r:1 w:1) - /// Proof: `Assets::Asset` (`max_values`: None, `max_size`: Some(210), added: 2685, mode: `MaxEncodedLen`) - /// Storage: `System::Account` (r:1 w:1) - /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) + // Measured: `417` + // Estimated: `0` + // Minimum execution time: 41_800_000 picoseconds. + Weight::from_parts(43_342_000, 0) + } fn refund() -> Weight { // Proof Size summary in bytes: - // Measured: `612` - // Estimated: `3675` - // Minimum execution time: 33_977_000 picoseconds. - Weight::from_parts(34_979_000, 3675) - .saturating_add(T::DbWeight::get().reads(3_u64)) - .saturating_add(T::DbWeight::get().writes(3_u64)) - } - /// Storage: `Assets::Account` (r:1 w:1) - /// Proof: `Assets::Account` (`max_values`: None, `max_size`: Some(134), added: 2609, mode: `MaxEncodedLen`) - /// Storage: `Assets::Asset` (r:1 w:1) - /// Proof: `Assets::Asset` (`max_values`: None, `max_size`: Some(210), added: 2685, mode: `MaxEncodedLen`) + // Measured: `645` + // Estimated: `0` + // Minimum execution time: 42_075_000 picoseconds. + Weight::from_parts(43_474_000, 0) + } fn refund_other() -> Weight { // Proof Size summary in bytes: - // Measured: `543` - // Estimated: `3675` - // Minimum execution time: 31_928_000 picoseconds. - Weight::from_parts(33_214_000, 3675) - .saturating_add(T::DbWeight::get().reads(2_u64)) - .saturating_add(T::DbWeight::get().writes(2_u64)) - } - /// Storage: `Assets::Asset` (r:1 w:0) - /// Proof: `Assets::Asset` (`max_values`: None, `max_size`: Some(210), added: 2685, mode: `MaxEncodedLen`) - /// Storage: `Assets::Account` (r:1 w:1) - /// Proof: `Assets::Account` (`max_values`: None, `max_size`: Some(134), added: 2609, mode: `MaxEncodedLen`) + // Measured: `576` + // Estimated: `0` + // Minimum execution time: 39_321_000 picoseconds. + Weight::from_parts(41_210_000, 0) + } fn block() -> Weight { // Proof Size summary in bytes: - // Measured: `492` - // Estimated: `3675` - // Minimum execution time: 19_186_000 picoseconds. - Weight::from_parts(20_104_000, 3675) - .saturating_add(T::DbWeight::get().reads(2_u64)) - .saturating_add(T::DbWeight::get().writes(1_u64)) - } - /// Storage: `Assets::Asset` (r:1 w:1) - /// Proof: `Assets::Asset` (`max_values`: None, `max_size`: Some(210), added: 2685, mode: `MaxEncodedLen`) - /// Storage: `Assets::Account` (r:2 w:2) - /// Proof: `Assets::Account` (`max_values`: None, `max_size`: Some(134), added: 2609, mode: `MaxEncodedLen`) - /// Storage: `System::Account` (r:1 w:1) - /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) + // Measured: `525` + // Estimated: `0` + // Minimum execution time: 23_485_000 picoseconds. + Weight::from_parts(24_387_000, 0) + } fn transfer_all() -> Weight { // Proof Size summary in bytes: - // Measured: `531` - // Estimated: `6208` - // Minimum execution time: 55_413_000 picoseconds. - Weight::from_parts(56_798_000, 6208) - .saturating_add(T::DbWeight::get().reads(4_u64)) - .saturating_add(T::DbWeight::get().writes(4_u64)) + // Measured: `564` + // Estimated: `0` + // Minimum execution time: 67_535_000 picoseconds. + Weight::from_parts(69_823_000, 0) } - /// Storage: `Assets::Asset` (r:1 w:0) - /// Proof: `Assets::Asset` (`max_values`: None, `max_size`: Some(210), added: 2685, mode: `MaxEncodedLen`) fn total_issuance() -> Weight { // Proof Size summary in bytes: - // Measured: `418` - // Estimated: `3675` - // Minimum execution time: 8_792_000 picoseconds. - Weight::from_parts(9_095_000, 3675) - .saturating_add(T::DbWeight::get().reads(1_u64)) + // Measured: `451` + // Estimated: `0` + // Minimum execution time: 10_690_000 picoseconds. + Weight::from_parts(11_461_000, 0) } - /// Storage: `Assets::Account` (r:1 w:0) - /// Proof: `Assets::Account` (`max_values`: None, `max_size`: Some(134), added: 2609, mode: `MaxEncodedLen`) fn balance() -> Weight { // Proof Size summary in bytes: - // Measured: `255` - // Estimated: `3599` - // Minimum execution time: 8_924_000 picoseconds. - Weight::from_parts(9_407_000, 3599) - .saturating_add(T::DbWeight::get().reads(1_u64)) + // Measured: `288` + // Estimated: `0` + // Minimum execution time: 11_164_000 picoseconds. + Weight::from_parts(11_464_000, 0) } - /// Storage: `Assets::Approvals` (r:1 w:0) - /// Proof: `Assets::Approvals` (`max_values`: None, `max_size`: Some(148), added: 2623, mode: `MaxEncodedLen`) fn allowance() -> Weight { // Proof Size summary in bytes: - // Measured: `350` - // Estimated: `3613` - // Minimum execution time: 11_348_000 picoseconds. - Weight::from_parts(11_882_000, 3613) - .saturating_add(T::DbWeight::get().reads(1_u64)) + // Measured: `383` + // Estimated: `0` + // Minimum execution time: 14_330_000 picoseconds. + Weight::from_parts(14_861_000, 0) } - /// The range of component `n` is `[0, 5]`. - /// The range of component `n` is `[0, 5]`. - /// The range of component `n` is `[0, 5]`. - fn set_reserves(n: u32) -> Weight { - Weight::from_parts(31_972_000, 3675) - // Standard Error: 13_748 - .saturating_add(Weight::from_parts(198_975, 0).saturating_mul(n.into())) - .saturating_add(RocksDbWeight::get().reads(1_u64)) - .saturating_add(RocksDbWeight::get().writes(1_u64)) + fn migration_v2_foreign_asset_set_reserve_weight() -> Weight { + // Proof Size summary in bytes: + // Measured: `256` + // Estimated: `0` + // Minimum execution time: 9_596_000 picoseconds. + Weight::from_parts(10_031_000, 0) + } + fn get_name() -> Weight { + // Proof Size summary in bytes: + // Measured: `344` + // Estimated: `0` + // Minimum execution time: 10_390_000 picoseconds. + Weight::from_parts(10_914_000, 0) + } + fn get_symbol() -> Weight { + // Proof Size summary in bytes: + // Measured: `344` + // Estimated: `0` + // Minimum execution time: 10_587_000 picoseconds. + Weight::from_parts(11_121_000, 0) + } + fn get_decimals() -> Weight { + // Proof Size summary in bytes: + // Measured: `344` + // Estimated: `0` + // Minimum execution time: 10_591_000 picoseconds. + Weight::from_parts(11_015_000, 0) } } // For backwards compatibility and tests. impl WeightInfo for () { - /// Storage: `Assets::Asset` (r:1 w:1) - /// Proof: `Assets::Asset` (`max_values`: None, `max_size`: Some(210), added: 2685, mode: `MaxEncodedLen`) - /// Storage: `Assets::NextAssetId` (r:1 w:0) - /// Proof: `Assets::NextAssetId` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) - /// Storage: `System::Account` (r:1 w:1) - /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) fn create() -> Weight { // Proof Size summary in bytes: - // Measured: `326` - // Estimated: `3675` - // Minimum execution time: 30_517_000 picoseconds. - Weight::from_parts(31_518_000, 3675) - .saturating_add(RocksDbWeight::get().reads(3_u64)) - .saturating_add(RocksDbWeight::get().writes(2_u64)) - } - /// Storage: `Assets::Asset` (r:1 w:1) - /// Proof: `Assets::Asset` (`max_values`: None, `max_size`: Some(210), added: 2685, mode: `MaxEncodedLen`) - /// Storage: `Assets::NextAssetId` (r:1 w:0) - /// Proof: `Assets::NextAssetId` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) + // Measured: `359` + // Estimated: `0` + // Minimum execution time: 37_906_000 picoseconds. + Weight::from_parts(39_021_000, 0) + } fn force_create() -> Weight { // Proof Size summary in bytes: - // Measured: `186` - // Estimated: `3675` - // Minimum execution time: 12_469_000 picoseconds. - Weight::from_parts(13_002_000, 3675) - .saturating_add(RocksDbWeight::get().reads(2_u64)) - .saturating_add(RocksDbWeight::get().writes(1_u64)) + // Measured: `219` + // Estimated: `0` + // Minimum execution time: 15_275_000 picoseconds. + Weight::from_parts(16_190_000, 0) } - /// Storage: `Assets::Asset` (r:1 w:1) - /// Proof: `Assets::Asset` (`max_values`: None, `max_size`: Some(210), added: 2685, mode: `MaxEncodedLen`) fn start_destroy() -> Weight { // Proof Size summary in bytes: - // Measured: `418` - // Estimated: `3675` - // Minimum execution time: 14_767_000 picoseconds. - Weight::from_parts(15_425_000, 3675) - .saturating_add(RocksDbWeight::get().reads(1_u64)) - .saturating_add(RocksDbWeight::get().writes(1_u64)) - } - /// Storage: `Assets::Asset` (r:1 w:1) - /// Proof: `Assets::Asset` (`max_values`: None, `max_size`: Some(210), added: 2685, mode: `MaxEncodedLen`) - /// Storage: `Assets::Account` (r:1001 w:1000) - /// Proof: `Assets::Account` (`max_values`: None, `max_size`: Some(134), added: 2609, mode: `MaxEncodedLen`) - /// Storage: `System::Account` (r:1000 w:1000) - /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) + // Measured: `451` + // Estimated: `0` + // Minimum execution time: 18_715_000 picoseconds. + Weight::from_parts(19_343_000, 0) + } /// The range of component `c` is `[0, 1000]`. - fn destroy_accounts(c: u32) -> Weight { - // Proof Size summary in bytes: - // Measured: `104 + c * (208 ±0)` - // Estimated: `3675 + c * (2609 ±0)` - // Minimum execution time: 18_900_000 picoseconds. - Weight::from_parts(19_222_000, 3675) - // Standard Error: 25_984 - .saturating_add(Weight::from_parts(15_436_025, 0).saturating_mul(c.into())) - .saturating_add(RocksDbWeight::get().reads(2_u64)) - .saturating_add(RocksDbWeight::get().reads((2_u64).saturating_mul(c.into()))) - .saturating_add(RocksDbWeight::get().writes(1_u64)) - .saturating_add(RocksDbWeight::get().writes((2_u64).saturating_mul(c.into()))) - .saturating_add(Weight::from_parts(0, 2609).saturating_mul(c.into())) - } - /// Storage: `Assets::Asset` (r:1 w:1) - /// Proof: `Assets::Asset` (`max_values`: None, `max_size`: Some(210), added: 2685, mode: `MaxEncodedLen`) - /// Storage: `Assets::Approvals` (r:1001 w:1000) - /// Proof: `Assets::Approvals` (`max_values`: None, `max_size`: Some(148), added: 2623, mode: `MaxEncodedLen`) + fn destroy_accounts(c: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `169 + c * (208 ±0)` + // Estimated: `0` + // Minimum execution time: 23_225_000 picoseconds. + Weight::from_parts(24_036_000, 0) + // Standard Error: 16_243 + .saturating_add(Weight::from_parts(16_075_928, 0).saturating_mul(c.into())) + } /// The range of component `a` is `[0, 1000]`. - fn destroy_approvals(a: u32) -> Weight { - // Proof Size summary in bytes: - // Measured: `555 + a * (86 ±0)` - // Estimated: `3675 + a * (2623 ±0)` - // Minimum execution time: 19_685_000 picoseconds. - Weight::from_parts(20_138_000, 3675) - // Standard Error: 10_401 - .saturating_add(Weight::from_parts(15_779_729, 0).saturating_mul(a.into())) - .saturating_add(RocksDbWeight::get().reads(2_u64)) - .saturating_add(RocksDbWeight::get().reads((1_u64).saturating_mul(a.into()))) - .saturating_add(RocksDbWeight::get().writes(1_u64)) - .saturating_add(RocksDbWeight::get().writes((1_u64).saturating_mul(a.into()))) - .saturating_add(Weight::from_parts(0, 2623).saturating_mul(a.into())) - } - /// Storage: `Assets::Asset` (r:1 w:1) - /// Proof: `Assets::Asset` (`max_values`: None, `max_size`: Some(210), added: 2685, mode: `MaxEncodedLen`) - /// Storage: `Assets::Metadata` (r:1 w:0) - /// Proof: `Assets::Metadata` (`max_values`: None, `max_size`: Some(140), added: 2615, mode: `MaxEncodedLen`) + fn destroy_approvals(a: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `588 + a * (86 ±0)` + // Estimated: `0` + // Minimum execution time: 24_564_000 picoseconds. + Weight::from_parts(25_003_000, 0) + // Standard Error: 19_112 + .saturating_add(Weight::from_parts(18_423_272, 0).saturating_mul(a.into())) + } fn finish_destroy() -> Weight { // Proof Size summary in bytes: - // Measured: `384` - // Estimated: `3675` - // Minimum execution time: 15_652_000 picoseconds. - Weight::from_parts(16_159_000, 3675) - .saturating_add(RocksDbWeight::get().reads(2_u64)) - .saturating_add(RocksDbWeight::get().writes(1_u64)) - } - /// Storage: `Assets::Asset` (r:1 w:1) - /// Proof: `Assets::Asset` (`max_values`: None, `max_size`: Some(210), added: 2685, mode: `MaxEncodedLen`) - /// Storage: `Assets::Account` (r:1 w:1) - /// Proof: `Assets::Account` (`max_values`: None, `max_size`: Some(134), added: 2609, mode: `MaxEncodedLen`) + // Measured: `417` + // Estimated: `0` + // Minimum execution time: 20_991_000 picoseconds. + Weight::from_parts(22_192_000, 0) + } fn mint() -> Weight { // Proof Size summary in bytes: - // Measured: `384` - // Estimated: `3675` - // Minimum execution time: 25_446_000 picoseconds. - Weight::from_parts(26_623_000, 3675) - .saturating_add(RocksDbWeight::get().reads(2_u64)) - .saturating_add(RocksDbWeight::get().writes(2_u64)) - } - /// Storage: `Assets::Asset` (r:1 w:1) - /// Proof: `Assets::Asset` (`max_values`: None, `max_size`: Some(210), added: 2685, mode: `MaxEncodedLen`) - /// Storage: `Assets::Account` (r:1 w:1) - /// Proof: `Assets::Account` (`max_values`: None, `max_size`: Some(134), added: 2609, mode: `MaxEncodedLen`) + // Measured: `417` + // Estimated: `0` + // Minimum execution time: 31_488_000 picoseconds. + Weight::from_parts(33_018_000, 0) + } fn burn() -> Weight { // Proof Size summary in bytes: - // Measured: `492` - // Estimated: `3675` - // Minimum execution time: 33_608_000 picoseconds. - Weight::from_parts(34_662_000, 3675) - .saturating_add(RocksDbWeight::get().reads(2_u64)) - .saturating_add(RocksDbWeight::get().writes(2_u64)) - } - /// Storage: `Assets::Asset` (r:1 w:1) - /// Proof: `Assets::Asset` (`max_values`: None, `max_size`: Some(210), added: 2685, mode: `MaxEncodedLen`) - /// Storage: `Assets::Account` (r:2 w:2) - /// Proof: `Assets::Account` (`max_values`: None, `max_size`: Some(134), added: 2609, mode: `MaxEncodedLen`) - /// Storage: `System::Account` (r:1 w:1) - /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) + // Measured: `525` + // Estimated: `0` + // Minimum execution time: 40_473_000 picoseconds. + Weight::from_parts(42_186_000, 0) + } fn transfer() -> Weight { // Proof Size summary in bytes: - // Measured: `531` - // Estimated: `6208` - // Minimum execution time: 46_426_000 picoseconds. - Weight::from_parts(47_772_000, 6208) - .saturating_add(RocksDbWeight::get().reads(4_u64)) - .saturating_add(RocksDbWeight::get().writes(4_u64)) - } - /// Storage: `Assets::Asset` (r:1 w:1) - /// Proof: `Assets::Asset` (`max_values`: None, `max_size`: Some(210), added: 2685, mode: `MaxEncodedLen`) - /// Storage: `Assets::Account` (r:2 w:2) - /// Proof: `Assets::Account` (`max_values`: None, `max_size`: Some(134), added: 2609, mode: `MaxEncodedLen`) - /// Storage: `System::Account` (r:1 w:1) - /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) + // Measured: `564` + // Estimated: `0` + // Minimum execution time: 56_280_000 picoseconds. + Weight::from_parts(58_051_000, 0) + } fn transfer_keep_alive() -> Weight { // Proof Size summary in bytes: - // Measured: `531` - // Estimated: `6208` - // Minimum execution time: 42_162_000 picoseconds. - Weight::from_parts(42_964_000, 6208) - .saturating_add(RocksDbWeight::get().reads(4_u64)) - .saturating_add(RocksDbWeight::get().writes(4_u64)) - } - /// Storage: `Assets::Asset` (r:1 w:1) - /// Proof: `Assets::Asset` (`max_values`: None, `max_size`: Some(210), added: 2685, mode: `MaxEncodedLen`) - /// Storage: `Assets::Account` (r:2 w:2) - /// Proof: `Assets::Account` (`max_values`: None, `max_size`: Some(134), added: 2609, mode: `MaxEncodedLen`) - /// Storage: `System::Account` (r:1 w:1) - /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) + // Measured: `564` + // Estimated: `0` + // Minimum execution time: 51_241_000 picoseconds. + Weight::from_parts(52_867_000, 0) + } fn force_transfer() -> Weight { // Proof Size summary in bytes: - // Measured: `531` - // Estimated: `6208` - // Minimum execution time: 46_399_000 picoseconds. - Weight::from_parts(47_580_000, 6208) - .saturating_add(RocksDbWeight::get().reads(4_u64)) - .saturating_add(RocksDbWeight::get().writes(4_u64)) - } - /// Storage: `Assets::Asset` (r:1 w:0) - /// Proof: `Assets::Asset` (`max_values`: None, `max_size`: Some(210), added: 2685, mode: `MaxEncodedLen`) - /// Storage: `Assets::Account` (r:1 w:1) - /// Proof: `Assets::Account` (`max_values`: None, `max_size`: Some(134), added: 2609, mode: `MaxEncodedLen`) + // Measured: `564` + // Estimated: `0` + // Minimum execution time: 55_379_000 picoseconds. + Weight::from_parts(57_682_000, 0) + } fn freeze() -> Weight { // Proof Size summary in bytes: - // Measured: `492` - // Estimated: `3675` - // Minimum execution time: 19_369_000 picoseconds. - Weight::from_parts(19_799_000, 3675) - .saturating_add(RocksDbWeight::get().reads(2_u64)) - .saturating_add(RocksDbWeight::get().writes(1_u64)) - } - /// Storage: `Assets::Asset` (r:1 w:0) - /// Proof: `Assets::Asset` (`max_values`: None, `max_size`: Some(210), added: 2685, mode: `MaxEncodedLen`) - /// Storage: `Assets::Account` (r:1 w:1) - /// Proof: `Assets::Account` (`max_values`: None, `max_size`: Some(134), added: 2609, mode: `MaxEncodedLen`) + // Measured: `525` + // Estimated: `0` + // Minimum execution time: 23_803_000 picoseconds. + Weight::from_parts(24_599_000, 0) + } fn thaw() -> Weight { // Proof Size summary in bytes: - // Measured: `492` - // Estimated: `3675` - // Minimum execution time: 19_145_000 picoseconds. - Weight::from_parts(19_873_000, 3675) - .saturating_add(RocksDbWeight::get().reads(2_u64)) - .saturating_add(RocksDbWeight::get().writes(1_u64)) + // Measured: `525` + // Estimated: `0` + // Minimum execution time: 23_390_000 picoseconds. + Weight::from_parts(24_391_000, 0) } - /// Storage: `Assets::Asset` (r:1 w:1) - /// Proof: `Assets::Asset` (`max_values`: None, `max_size`: Some(210), added: 2685, mode: `MaxEncodedLen`) fn freeze_asset() -> Weight { // Proof Size summary in bytes: - // Measured: `418` - // Estimated: `3675` - // Minimum execution time: 14_728_000 picoseconds. - Weight::from_parts(15_405_000, 3675) - .saturating_add(RocksDbWeight::get().reads(1_u64)) - .saturating_add(RocksDbWeight::get().writes(1_u64)) + // Measured: `451` + // Estimated: `0` + // Minimum execution time: 18_154_000 picoseconds. + Weight::from_parts(18_948_000, 0) } - /// Storage: `Assets::Asset` (r:1 w:1) - /// Proof: `Assets::Asset` (`max_values`: None, `max_size`: Some(210), added: 2685, mode: `MaxEncodedLen`) fn thaw_asset() -> Weight { // Proof Size summary in bytes: - // Measured: `418` - // Estimated: `3675` - // Minimum execution time: 14_730_000 picoseconds. - Weight::from_parts(15_284_000, 3675) - .saturating_add(RocksDbWeight::get().reads(1_u64)) - .saturating_add(RocksDbWeight::get().writes(1_u64)) - } - /// Storage: `Assets::Asset` (r:1 w:1) - /// Proof: `Assets::Asset` (`max_values`: None, `max_size`: Some(210), added: 2685, mode: `MaxEncodedLen`) - /// Storage: `Assets::Metadata` (r:1 w:0) - /// Proof: `Assets::Metadata` (`max_values`: None, `max_size`: Some(140), added: 2615, mode: `MaxEncodedLen`) + // Measured: `451` + // Estimated: `0` + // Minimum execution time: 18_529_000 picoseconds. + Weight::from_parts(19_122_000, 0) + } fn transfer_ownership() -> Weight { // Proof Size summary in bytes: - // Measured: `384` - // Estimated: `3675` - // Minimum execution time: 16_247_000 picoseconds. - Weight::from_parts(16_890_000, 3675) - .saturating_add(RocksDbWeight::get().reads(2_u64)) - .saturating_add(RocksDbWeight::get().writes(1_u64)) + // Measured: `417` + // Estimated: `0` + // Minimum execution time: 19_860_000 picoseconds. + Weight::from_parts(20_868_000, 0) } - /// Storage: `Assets::Asset` (r:1 w:1) - /// Proof: `Assets::Asset` (`max_values`: None, `max_size`: Some(210), added: 2685, mode: `MaxEncodedLen`) fn set_team() -> Weight { // Proof Size summary in bytes: - // Measured: `384` - // Estimated: `3675` - // Minimum execution time: 14_206_000 picoseconds. - Weight::from_parts(14_856_000, 3675) - .saturating_add(RocksDbWeight::get().reads(1_u64)) - .saturating_add(RocksDbWeight::get().writes(1_u64)) - } - /// Storage: `Assets::Asset` (r:1 w:0) - /// Proof: `Assets::Asset` (`max_values`: None, `max_size`: Some(210), added: 2685, mode: `MaxEncodedLen`) - /// Storage: `Assets::Metadata` (r:1 w:1) - /// Proof: `Assets::Metadata` (`max_values`: None, `max_size`: Some(140), added: 2615, mode: `MaxEncodedLen`) + // Measured: `417` + // Estimated: `0` + // Minimum execution time: 17_895_000 picoseconds. + Weight::from_parts(18_788_000, 0) + } + /// The range of component `n` is `[0, 5]`. + fn set_reserves(n: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `417` + // Estimated: `0` + // Minimum execution time: 19_036_000 picoseconds. + Weight::from_parts(20_416_156, 0) + // Standard Error: 8_444 + .saturating_add(Weight::from_parts(86_263, 0).saturating_mul(n.into())) + } /// The range of component `n` is `[0, 50]`. /// The range of component `s` is `[0, 50]`. - fn set_metadata(_n: u32, s: u32) -> Weight { - // Proof Size summary in bytes: - // Measured: `384` - // Estimated: `3675` - // Minimum execution time: 30_217_000 picoseconds. - Weight::from_parts(31_869_256, 3675) - // Standard Error: 1_165 - .saturating_add(Weight::from_parts(826, 0).saturating_mul(s.into())) - .saturating_add(RocksDbWeight::get().reads(2_u64)) - .saturating_add(RocksDbWeight::get().writes(1_u64)) - } - /// Storage: `Assets::Asset` (r:1 w:0) - /// Proof: `Assets::Asset` (`max_values`: None, `max_size`: Some(210), added: 2685, mode: `MaxEncodedLen`) - /// Storage: `Assets::Metadata` (r:1 w:1) - /// Proof: `Assets::Metadata` (`max_values`: None, `max_size`: Some(140), added: 2615, mode: `MaxEncodedLen`) + fn set_metadata(n: u32, s: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `417` + // Estimated: `0` + // Minimum execution time: 37_385_000 picoseconds. + Weight::from_parts(39_399_235, 0) + // Standard Error: 2_083 + .saturating_add(Weight::from_parts(6_204, 0).saturating_mul(n.into())) + // Standard Error: 2_083 + .saturating_add(Weight::from_parts(4_848, 0).saturating_mul(s.into())) + } fn clear_metadata() -> Weight { // Proof Size summary in bytes: - // Measured: `548` - // Estimated: `3675` - // Minimum execution time: 29_914_000 picoseconds. - Weight::from_parts(30_680_000, 3675) - .saturating_add(RocksDbWeight::get().reads(2_u64)) - .saturating_add(RocksDbWeight::get().writes(1_u64)) - } - /// Storage: `Assets::Asset` (r:1 w:0) - /// Proof: `Assets::Asset` (`max_values`: None, `max_size`: Some(210), added: 2685, mode: `MaxEncodedLen`) - /// Storage: `Assets::Metadata` (r:1 w:1) - /// Proof: `Assets::Metadata` (`max_values`: None, `max_size`: Some(140), added: 2615, mode: `MaxEncodedLen`) + // Measured: `581` + // Estimated: `0` + // Minimum execution time: 37_347_000 picoseconds. + Weight::from_parts(38_771_000, 0) + } /// The range of component `n` is `[0, 50]`. /// The range of component `s` is `[0, 50]`. - fn force_set_metadata(n: u32, s: u32) -> Weight { - // Proof Size summary in bytes: - // Measured: `223` - // Estimated: `3675` - // Minimum execution time: 13_045_000 picoseconds. - Weight::from_parts(13_680_991, 3675) - // Standard Error: 528 - .saturating_add(Weight::from_parts(3_162, 0).saturating_mul(n.into())) - // Standard Error: 528 - .saturating_add(Weight::from_parts(2_931, 0).saturating_mul(s.into())) - .saturating_add(RocksDbWeight::get().reads(2_u64)) - .saturating_add(RocksDbWeight::get().writes(1_u64)) - } - /// Storage: `Assets::Asset` (r:1 w:0) - /// Proof: `Assets::Asset` (`max_values`: None, `max_size`: Some(210), added: 2685, mode: `MaxEncodedLen`) - /// Storage: `Assets::Metadata` (r:1 w:1) - /// Proof: `Assets::Metadata` (`max_values`: None, `max_size`: Some(140), added: 2615, mode: `MaxEncodedLen`) + fn force_set_metadata(n: u32, s: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `256` + // Estimated: `0` + // Minimum execution time: 15_827_000 picoseconds. + Weight::from_parts(17_156_574, 0) + // Standard Error: 698 + .saturating_add(Weight::from_parts(72, 0).saturating_mul(n.into())) + // Standard Error: 698 + .saturating_add(Weight::from_parts(1_802, 0).saturating_mul(s.into())) + } fn force_clear_metadata() -> Weight { // Proof Size summary in bytes: - // Measured: `548` - // Estimated: `3675` - // Minimum execution time: 29_440_000 picoseconds. - Weight::from_parts(30_302_000, 3675) - .saturating_add(RocksDbWeight::get().reads(2_u64)) - .saturating_add(RocksDbWeight::get().writes(1_u64)) + // Measured: `581` + // Estimated: `0` + // Minimum execution time: 36_270_000 picoseconds. + Weight::from_parts(37_551_000, 0) } - /// Storage: `Assets::Asset` (r:1 w:1) - /// Proof: `Assets::Asset` (`max_values`: None, `max_size`: Some(210), added: 2685, mode: `MaxEncodedLen`) fn force_asset_status() -> Weight { // Proof Size summary in bytes: - // Measured: `384` - // Estimated: `3675` - // Minimum execution time: 14_175_000 picoseconds. - Weight::from_parts(14_802_000, 3675) - .saturating_add(RocksDbWeight::get().reads(1_u64)) - .saturating_add(RocksDbWeight::get().writes(1_u64)) - } - /// Storage: `Assets::Asset` (r:1 w:1) - /// Proof: `Assets::Asset` (`max_values`: None, `max_size`: Some(210), added: 2685, mode: `MaxEncodedLen`) - /// Storage: `Assets::Approvals` (r:1 w:1) - /// Proof: `Assets::Approvals` (`max_values`: None, `max_size`: Some(148), added: 2623, mode: `MaxEncodedLen`) + // Measured: `417` + // Estimated: `0` + // Minimum execution time: 17_570_000 picoseconds. + Weight::from_parts(18_289_000, 0) + } fn approve_transfer() -> Weight { // Proof Size summary in bytes: - // Measured: `418` - // Estimated: `3675` - // Minimum execution time: 34_027_000 picoseconds. - Weight::from_parts(34_976_000, 3675) - .saturating_add(RocksDbWeight::get().reads(2_u64)) - .saturating_add(RocksDbWeight::get().writes(2_u64)) - } - /// Storage: `Assets::Asset` (r:1 w:1) - /// Proof: `Assets::Asset` (`max_values`: None, `max_size`: Some(210), added: 2685, mode: `MaxEncodedLen`) - /// Storage: `Assets::Approvals` (r:1 w:1) - /// Proof: `Assets::Approvals` (`max_values`: None, `max_size`: Some(148), added: 2623, mode: `MaxEncodedLen`) - /// Storage: `Assets::Account` (r:2 w:2) - /// Proof: `Assets::Account` (`max_values`: None, `max_size`: Some(134), added: 2609, mode: `MaxEncodedLen`) - /// Storage: `System::Account` (r:1 w:1) - /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) + // Measured: `451` + // Estimated: `0` + // Minimum execution time: 42_667_000 picoseconds. + Weight::from_parts(44_135_000, 0) + } fn transfer_approved() -> Weight { // Proof Size summary in bytes: - // Measured: `701` - // Estimated: `6208` - // Minimum execution time: 66_073_000 picoseconds. - Weight::from_parts(69_478_000, 6208) - .saturating_add(RocksDbWeight::get().reads(5_u64)) - .saturating_add(RocksDbWeight::get().writes(5_u64)) - } - /// Storage: `Assets::Asset` (r:1 w:1) - /// Proof: `Assets::Asset` (`max_values`: None, `max_size`: Some(210), added: 2685, mode: `MaxEncodedLen`) - /// Storage: `Assets::Approvals` (r:1 w:1) - /// Proof: `Assets::Approvals` (`max_values`: None, `max_size`: Some(148), added: 2623, mode: `MaxEncodedLen`) + // Measured: `734` + // Estimated: `0` + // Minimum execution time: 80_961_000 picoseconds. + Weight::from_parts(83_202_000, 0) + } fn cancel_approval() -> Weight { // Proof Size summary in bytes: - // Measured: `588` - // Estimated: `3675` - // Minimum execution time: 35_452_000 picoseconds. - Weight::from_parts(36_883_000, 3675) - .saturating_add(RocksDbWeight::get().reads(2_u64)) - .saturating_add(RocksDbWeight::get().writes(2_u64)) - } - /// Storage: `Assets::Asset` (r:1 w:1) - /// Proof: `Assets::Asset` (`max_values`: None, `max_size`: Some(210), added: 2685, mode: `MaxEncodedLen`) - /// Storage: `Assets::Approvals` (r:1 w:1) - /// Proof: `Assets::Approvals` (`max_values`: None, `max_size`: Some(148), added: 2623, mode: `MaxEncodedLen`) + // Measured: `621` + // Estimated: `0` + // Minimum execution time: 44_631_000 picoseconds. + Weight::from_parts(45_692_000, 0) + } fn force_cancel_approval() -> Weight { // Proof Size summary in bytes: - // Measured: `588` - // Estimated: `3675` - // Minimum execution time: 35_154_000 picoseconds. - Weight::from_parts(36_578_000, 3675) - .saturating_add(RocksDbWeight::get().reads(2_u64)) - .saturating_add(RocksDbWeight::get().writes(2_u64)) + // Measured: `621` + // Estimated: `0` + // Minimum execution time: 43_978_000 picoseconds. + Weight::from_parts(45_190_000, 0) } - /// Storage: `Assets::Asset` (r:1 w:1) - /// Proof: `Assets::Asset` (`max_values`: None, `max_size`: Some(210), added: 2685, mode: `MaxEncodedLen`) fn set_min_balance() -> Weight { // Proof Size summary in bytes: - // Measured: `384` - // Estimated: `3675` - // Minimum execution time: 14_904_000 picoseconds. - Weight::from_parts(15_505_000, 3675) - .saturating_add(RocksDbWeight::get().reads(1_u64)) - .saturating_add(RocksDbWeight::get().writes(1_u64)) - } - /// Storage: `Assets::Account` (r:1 w:1) - /// Proof: `Assets::Account` (`max_values`: None, `max_size`: Some(134), added: 2609, mode: `MaxEncodedLen`) - /// Storage: `Assets::Asset` (r:1 w:1) - /// Proof: `Assets::Asset` (`max_values`: None, `max_size`: Some(210), added: 2685, mode: `MaxEncodedLen`) - /// Storage: `System::Account` (r:1 w:1) - /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) + // Measured: `417` + // Estimated: `0` + // Minimum execution time: 18_750_000 picoseconds. + Weight::from_parts(19_531_000, 0) + } fn touch() -> Weight { // Proof Size summary in bytes: - // Measured: `486` - // Estimated: `3675` - // Minimum execution time: 35_434_000 picoseconds. - Weight::from_parts(36_636_000, 3675) - .saturating_add(RocksDbWeight::get().reads(3_u64)) - .saturating_add(RocksDbWeight::get().writes(3_u64)) - } - /// Storage: `Assets::Account` (r:1 w:1) - /// Proof: `Assets::Account` (`max_values`: None, `max_size`: Some(134), added: 2609, mode: `MaxEncodedLen`) - /// Storage: `Assets::Asset` (r:1 w:1) - /// Proof: `Assets::Asset` (`max_values`: None, `max_size`: Some(210), added: 2685, mode: `MaxEncodedLen`) + // Measured: `519` + // Estimated: `0` + // Minimum execution time: 44_307_000 picoseconds. + Weight::from_parts(45_710_000, 0) + } fn touch_other() -> Weight { // Proof Size summary in bytes: - // Measured: `384` - // Estimated: `3675` - // Minimum execution time: 33_361_000 picoseconds. - Weight::from_parts(34_522_000, 3675) - .saturating_add(RocksDbWeight::get().reads(2_u64)) - .saturating_add(RocksDbWeight::get().writes(2_u64)) - } - /// Storage: `Assets::Account` (r:1 w:1) - /// Proof: `Assets::Account` (`max_values`: None, `max_size`: Some(134), added: 2609, mode: `MaxEncodedLen`) - /// Storage: `Assets::Asset` (r:1 w:1) - /// Proof: `Assets::Asset` (`max_values`: None, `max_size`: Some(210), added: 2685, mode: `MaxEncodedLen`) - /// Storage: `System::Account` (r:1 w:1) - /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) + // Measured: `417` + // Estimated: `0` + // Minimum execution time: 41_800_000 picoseconds. + Weight::from_parts(43_342_000, 0) + } fn refund() -> Weight { // Proof Size summary in bytes: - // Measured: `612` - // Estimated: `3675` - // Minimum execution time: 33_977_000 picoseconds. - Weight::from_parts(34_979_000, 3675) - .saturating_add(RocksDbWeight::get().reads(3_u64)) - .saturating_add(RocksDbWeight::get().writes(3_u64)) - } - /// Storage: `Assets::Account` (r:1 w:1) - /// Proof: `Assets::Account` (`max_values`: None, `max_size`: Some(134), added: 2609, mode: `MaxEncodedLen`) - /// Storage: `Assets::Asset` (r:1 w:1) - /// Proof: `Assets::Asset` (`max_values`: None, `max_size`: Some(210), added: 2685, mode: `MaxEncodedLen`) + // Measured: `645` + // Estimated: `0` + // Minimum execution time: 42_075_000 picoseconds. + Weight::from_parts(43_474_000, 0) + } fn refund_other() -> Weight { // Proof Size summary in bytes: - // Measured: `543` - // Estimated: `3675` - // Minimum execution time: 31_928_000 picoseconds. - Weight::from_parts(33_214_000, 3675) - .saturating_add(RocksDbWeight::get().reads(2_u64)) - .saturating_add(RocksDbWeight::get().writes(2_u64)) - } - /// Storage: `Assets::Asset` (r:1 w:0) - /// Proof: `Assets::Asset` (`max_values`: None, `max_size`: Some(210), added: 2685, mode: `MaxEncodedLen`) - /// Storage: `Assets::Account` (r:1 w:1) - /// Proof: `Assets::Account` (`max_values`: None, `max_size`: Some(134), added: 2609, mode: `MaxEncodedLen`) + // Measured: `576` + // Estimated: `0` + // Minimum execution time: 39_321_000 picoseconds. + Weight::from_parts(41_210_000, 0) + } fn block() -> Weight { // Proof Size summary in bytes: - // Measured: `492` - // Estimated: `3675` - // Minimum execution time: 19_186_000 picoseconds. - Weight::from_parts(20_104_000, 3675) - .saturating_add(RocksDbWeight::get().reads(2_u64)) - .saturating_add(RocksDbWeight::get().writes(1_u64)) - } - /// Storage: `Assets::Asset` (r:1 w:1) - /// Proof: `Assets::Asset` (`max_values`: None, `max_size`: Some(210), added: 2685, mode: `MaxEncodedLen`) - /// Storage: `Assets::Account` (r:2 w:2) - /// Proof: `Assets::Account` (`max_values`: None, `max_size`: Some(134), added: 2609, mode: `MaxEncodedLen`) - /// Storage: `System::Account` (r:1 w:1) - /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) + // Measured: `525` + // Estimated: `0` + // Minimum execution time: 23_485_000 picoseconds. + Weight::from_parts(24_387_000, 0) + } fn transfer_all() -> Weight { // Proof Size summary in bytes: - // Measured: `531` - // Estimated: `6208` - // Minimum execution time: 55_413_000 picoseconds. - Weight::from_parts(56_798_000, 6208) - .saturating_add(RocksDbWeight::get().reads(4_u64)) - .saturating_add(RocksDbWeight::get().writes(4_u64)) + // Measured: `564` + // Estimated: `0` + // Minimum execution time: 67_535_000 picoseconds. + Weight::from_parts(69_823_000, 0) } - /// Storage: `Assets::Asset` (r:1 w:0) - /// Proof: `Assets::Asset` (`max_values`: None, `max_size`: Some(210), added: 2685, mode: `MaxEncodedLen`) fn total_issuance() -> Weight { // Proof Size summary in bytes: - // Measured: `418` - // Estimated: `3675` - // Minimum execution time: 8_792_000 picoseconds. - Weight::from_parts(9_095_000, 3675) - .saturating_add(RocksDbWeight::get().reads(1_u64)) + // Measured: `451` + // Estimated: `0` + // Minimum execution time: 10_690_000 picoseconds. + Weight::from_parts(11_461_000, 0) } - /// Storage: `Assets::Account` (r:1 w:0) - /// Proof: `Assets::Account` (`max_values`: None, `max_size`: Some(134), added: 2609, mode: `MaxEncodedLen`) fn balance() -> Weight { // Proof Size summary in bytes: - // Measured: `255` - // Estimated: `3599` - // Minimum execution time: 8_924_000 picoseconds. - Weight::from_parts(9_407_000, 3599) - .saturating_add(RocksDbWeight::get().reads(1_u64)) + // Measured: `288` + // Estimated: `0` + // Minimum execution time: 11_164_000 picoseconds. + Weight::from_parts(11_464_000, 0) } - /// Storage: `Assets::Approvals` (r:1 w:0) - /// Proof: `Assets::Approvals` (`max_values`: None, `max_size`: Some(148), added: 2623, mode: `MaxEncodedLen`) fn allowance() -> Weight { // Proof Size summary in bytes: - // Measured: `350` - // Estimated: `3613` - // Minimum execution time: 11_348_000 picoseconds. - Weight::from_parts(11_882_000, 3613) - .saturating_add(RocksDbWeight::get().reads(1_u64)) + // Measured: `383` + // Estimated: `0` + // Minimum execution time: 14_330_000 picoseconds. + Weight::from_parts(14_861_000, 0) } - /// The range of component `n` is `[0, 5]`. - /// The range of component `n` is `[0, 5]`. - /// The range of component `n` is `[0, 5]`. - fn set_reserves(n: u32) -> Weight { - Weight::from_parts(31_972_000, 3675) - // Standard Error: 13_748 - .saturating_add(Weight::from_parts(198_975, 0).saturating_mul(n.into())) - .saturating_add(RocksDbWeight::get().reads(1_u64)) - .saturating_add(RocksDbWeight::get().writes(1_u64)) + fn migration_v2_foreign_asset_set_reserve_weight() -> Weight { + // Proof Size summary in bytes: + // Measured: `256` + // Estimated: `0` + // Minimum execution time: 9_596_000 picoseconds. + Weight::from_parts(10_031_000, 0) + } + fn get_name() -> Weight { + // Proof Size summary in bytes: + // Measured: `344` + // Estimated: `0` + // Minimum execution time: 10_390_000 picoseconds. + Weight::from_parts(10_914_000, 0) + } + fn get_symbol() -> Weight { + // Proof Size summary in bytes: + // Measured: `344` + // Estimated: `0` + // Minimum execution time: 10_587_000 picoseconds. + Weight::from_parts(11_121_000, 0) + } + fn get_decimals() -> Weight { + // Proof Size summary in bytes: + // Measured: `344` + // Estimated: `0` + // Minimum execution time: 10_591_000 picoseconds. + Weight::from_parts(11_015_000, 0) } } diff --git a/substrate/frame/staking-async/runtimes/parachain/src/weights/pallet_assets_foreign.rs b/substrate/frame/staking-async/runtimes/parachain/src/weights/pallet_assets_foreign.rs index 8240ca7b0b918..8f817e96f206f 100644 --- a/substrate/frame/staking-async/runtimes/parachain/src/weights/pallet_assets_foreign.rs +++ b/substrate/frame/staking-async/runtimes/parachain/src/weights/pallet_assets_foreign.rs @@ -636,4 +636,32 @@ impl pallet_assets::WeightInfo for WeightInfo { .saturating_add(T::DbWeight::get().reads(1_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } + fn migration_v2_foreign_asset_set_reserve_weight() -> Weight { + // Proof Size summary in bytes: + // Measured: `256` + // Estimated: `0` + // Minimum execution time: 9_596_000 picoseconds. + Weight::from_parts(10_031_000, 0) + } + fn get_name() -> Weight { + // Proof Size summary in bytes: + // Measured: `344` + // Estimated: `0` + // Minimum execution time: 10_390_000 picoseconds. + Weight::from_parts(10_914_000, 0) + } + fn get_symbol() -> Weight { + // Proof Size summary in bytes: + // Measured: `344` + // Estimated: `0` + // Minimum execution time: 10_587_000 picoseconds. + Weight::from_parts(11_121_000, 0) + } + fn get_decimals() -> Weight { + // Proof Size summary in bytes: + // Measured: `344` + // Estimated: `0` + // Minimum execution time: 10_591_000 picoseconds. + Weight::from_parts(11_015_000, 0) + } } diff --git a/substrate/frame/staking-async/runtimes/parachain/src/weights/pallet_assets_local.rs b/substrate/frame/staking-async/runtimes/parachain/src/weights/pallet_assets_local.rs index 4e4cfd96c62e6..a14afce22a881 100644 --- a/substrate/frame/staking-async/runtimes/parachain/src/weights/pallet_assets_local.rs +++ b/substrate/frame/staking-async/runtimes/parachain/src/weights/pallet_assets_local.rs @@ -632,4 +632,32 @@ impl pallet_assets::WeightInfo for WeightInfo { .saturating_add(T::DbWeight::get().reads(1_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } + fn migration_v2_foreign_asset_set_reserve_weight() -> Weight { + // Proof Size summary in bytes: + // Measured: `256` + // Estimated: `0` + // Minimum execution time: 9_596_000 picoseconds. + Weight::from_parts(10_031_000, 0) + } + fn get_name() -> Weight { + // Proof Size summary in bytes: + // Measured: `344` + // Estimated: `0` + // Minimum execution time: 10_390_000 picoseconds. + Weight::from_parts(10_914_000, 0) + } + fn get_symbol() -> Weight { + // Proof Size summary in bytes: + // Measured: `344` + // Estimated: `0` + // Minimum execution time: 10_587_000 picoseconds. + Weight::from_parts(11_121_000, 0) + } + fn get_decimals() -> Weight { + // Proof Size summary in bytes: + // Measured: `344` + // Estimated: `0` + // Minimum execution time: 10_591_000 picoseconds. + Weight::from_parts(11_015_000, 0) + } } diff --git a/substrate/frame/staking-async/runtimes/parachain/src/weights/pallet_assets_pool.rs b/substrate/frame/staking-async/runtimes/parachain/src/weights/pallet_assets_pool.rs index 0b0e9bde4ba82..354831cb497dc 100644 --- a/substrate/frame/staking-async/runtimes/parachain/src/weights/pallet_assets_pool.rs +++ b/substrate/frame/staking-async/runtimes/parachain/src/weights/pallet_assets_pool.rs @@ -626,4 +626,32 @@ impl pallet_assets::WeightInfo for WeightInfo { .saturating_add(T::DbWeight::get().reads(1_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } + fn migration_v2_foreign_asset_set_reserve_weight() -> Weight { + // Proof Size summary in bytes: + // Measured: `256` + // Estimated: `0` + // Minimum execution time: 9_596_000 picoseconds. + Weight::from_parts(10_031_000, 0) + } + fn get_name() -> Weight { + // Proof Size summary in bytes: + // Measured: `344` + // Estimated: `0` + // Minimum execution time: 10_390_000 picoseconds. + Weight::from_parts(10_914_000, 0) + } + fn get_symbol() -> Weight { + // Proof Size summary in bytes: + // Measured: `344` + // Estimated: `0` + // Minimum execution time: 10_587_000 picoseconds. + Weight::from_parts(11_121_000, 0) + } + fn get_decimals() -> Weight { + // Proof Size summary in bytes: + // Measured: `344` + // Estimated: `0` + // Minimum execution time: 10_591_000 picoseconds. + Weight::from_parts(11_015_000, 0) + } } diff --git a/substrate/primitives/ethereum-standards/src/IERC20.sol b/substrate/primitives/ethereum-standards/src/IERC20.sol index 6b33f25d44e53..6eb87a08b802a 100644 --- a/substrate/primitives/ethereum-standards/src/IERC20.sol +++ b/substrate/primitives/ethereum-standards/src/IERC20.sol @@ -1,63 +1,89 @@ // SPDX-License-Identifier: MIT -// OpenZeppelin Contracts (last updated v5.1.0) (token/ERC20/IERC20.sol) +// This interface combines methods from two OpenZeppelin contracts: +// +// IERC20.sol (base ERC-20 interface) // https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/token/ERC20/IERC20.sol +// +// IERC20Metadata.sol (ERC-20 metadata extension) +// https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/token/ERC20/extensions/IERC20Metadata.sol +// pragma solidity ^0.8.20; /// -/// @dev Interface of the ERC-20 standard as defined in the ERC. +/// @dev Interface combining the ERC-20 standard and its metadata extension. +/// Note: Due to ABI generation constraints, both interfaces are merged into a single contract. /// interface IERC20 { - /// @dev Emitted when `value` tokens are moved from one account (`from`) to - /// another (`to`). - /// - /// Note that `value` may be zero. + // ============================================================ + // IERC20 - Base ERC-20 Interface + // https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/token/ERC20/IERC20.sol + // ============================================================ + + /// @dev Emitted when `value` tokens are moved from one account (`from`) to + /// another (`to`). + /// + /// Note that `value` may be zero. event Transfer(address indexed from, address indexed to, uint256 value); - /// @dev Emitted when the allowance of a `spender` for an `owner` is set by - /// a call to {approve}. `value` is the new allowance. + /// @dev Emitted when the allowance of a `spender` for an `owner` is set by + /// a call to {approve}. `value` is the new allowance. event Approval(address indexed owner, address indexed spender, uint256 value); - /// @dev Returns the value of tokens in existence. + /// @dev Returns the value of tokens in existence. function totalSupply() external view returns (uint256); - /// @dev Returns the value of tokens owned by `account`. + /// @dev Returns the value of tokens owned by `account`. function balanceOf(address account) external view returns (uint256); - /// @dev Moves a `value` amount of tokens from the caller's account to `to`. - /// - /// Returns a boolean value indicating whether the operation succeeded. - /// - /// Emits a {Transfer} event. + /// @dev Moves a `value` amount of tokens from the caller's account to `to`. + /// + /// Returns a boolean value indicating whether the operation succeeded. + /// + /// Emits a {Transfer} event. function transfer(address to, uint256 value) external returns (bool); - /// @dev Returns the remaining number of tokens that `spender` will be - /// allowed to spend on behalf of `owner` through {transferFrom}. This is - /// zero by default. - /// - /// This value changes when {approve} or {transferFrom} are called. + /// @dev Returns the remaining number of tokens that `spender` will be + /// allowed to spend on behalf of `owner` through {transferFrom}. This is + /// zero by default. + /// + /// This value changes when {approve} or {transferFrom} are called. function allowance(address owner, address spender) external view returns (uint256); - /// @dev Sets a `value` amount of tokens as the allowance of `spender` over the - /// caller's tokens. - /// - /// Returns a boolean value indicating whether the operation succeeded. - /// - /// IMPORTANT: Beware that changing an allowance with this method brings the risk - /// that someone may use both the old and the new allowance by unfortunate - /// transaction ordering. One possible solution to mitigate this race - /// condition is to first reduce the spender's allowance to 0 and set the - /// desired value afterwards: - /// https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 - /// - /// Emits an {Approval} event. + /// @dev Sets a `value` amount of tokens as the allowance of `spender` over the + /// caller's tokens. + /// + /// Returns a boolean value indicating whether the operation succeeded. + /// + /// IMPORTANT: Beware that changing an allowance with this method brings the risk + /// that someone may use both the old and the new allowance by unfortunate + /// transaction ordering. One possible solution to mitigate this race + /// condition is to first reduce the spender's allowance to 0 and set the + /// desired value afterwards: + /// https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 + /// + /// Emits an {Approval} event. function approve(address spender, uint256 value) external returns (bool); - /// @dev Moves a `value` amount of tokens from `from` to `to` using the - /// allowance mechanism. `value` is then deducted from the caller's - /// allowance. - /// - /// Returns a boolean value indicating whether the operation succeeded. - /// - /// Emits a {Transfer} event. + /// @dev Moves a `value` amount of tokens from `from` to `to` using the + /// allowance mechanism. `value` is then deducted from the caller's + /// allowance. + /// + /// Returns a boolean value indicating whether the operation succeeded. + /// + /// Emits a {Transfer} event. function transferFrom(address from, address to, uint256 value) external returns (bool); + + // ============================================================ + // IERC20Metadata - ERC-20 Metadata Extension + // https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/token/ERC20/extensions/IERC20Metadata.sol + // ============================================================ + + /// @dev Returns the name of the token. + function name() external view returns (string memory); + + /// @dev Returns the symbol of the token. + function symbol() external view returns (string memory); + + /// @dev Returns the decimals places of the token. + function decimals() external view returns (uint8); }