git.delta.rocks / unique-network / refs/commits / 3f089fc34b06

difftreelog

refactor EthCrossAccount impl, signature some evm methods, tests and stubs

PraetorP2022-12-14parent: #1f3c059.patch.diff
in: master

16 files changed

modifiedpallets/common/src/erc.rsdiffbeforeafterboth
--- a/pallets/common/src/erc.rs
+++ b/pallets/common/src/erc.rs
@@ -36,7 +36,7 @@
 use crate::{
 	Pallet, CollectionHandle, Config, CollectionProperties, SelfWeightOf,
 	eth::{
-		EthCrossAccount, convert_cross_account_to_uint256, CollectionPermissions as EvmPermissions,
+		EthCrossAccount, CollectionPermissions as EvmPermissions,
 		CollectionLimits as EvmCollectionLimits,
 	},
 	weights::WeightInfo,
modifiedpallets/common/src/eth.rsdiffbeforeafterboth
--- a/pallets/common/src/eth.rs
+++ b/pallets/common/src/eth.rs
@@ -53,15 +53,6 @@
 	address[0..16] == ETH_COLLECTION_PREFIX
 }
 
-/// Convert `CrossAccountId` to `uint256`.
-pub fn convert_cross_account_to_uint256<T: Config>(from: &T::CrossAccountId) -> uint256
-where
-	T::AccountId: AsRef<[u8; 32]>,
-{
-	let slice = from.as_sub().as_ref();
-	uint256::from_big_endian(slice)
-}
-
 /// Convert `uint256` to `CrossAccountId`.
 pub fn convert_uint256_to_cross_account<T: Config>(from: uint256) -> T::CrossAccountId
 where
@@ -71,22 +62,6 @@
 	from.to_big_endian(&mut new_admin_arr);
 	let account_id = T::AccountId::from(new_admin_arr);
 	T::CrossAccountId::from_sub(account_id)
-}
-
-/// Convert `CrossAccountId` to `(address, uint256)`.
-pub fn convert_cross_account_to_tuple<T: Config>(
-	cross_account_id: &T::CrossAccountId,
-) -> (address, uint256)
-where
-	T::AccountId: AsRef<[u8; 32]>,
-{
-	if cross_account_id.is_canonical_substrate() {
-		let sub = convert_cross_account_to_uint256::<T>(cross_account_id);
-		(Default::default(), sub)
-	} else {
-		let eth = *cross_account_id.as_eth();
-		(eth, Default::default())
-	}
 }
 
 /// Convert tuple `(address, uint256)` to `CrossAccountId`.
@@ -128,10 +103,7 @@
 		T::AccountId: AsRef<[u8; 32]>,
 	{
 		if cross_account_id.is_canonical_substrate() {
-			Self {
-				eth: Default::default(),
-				sub: convert_cross_account_to_uint256::<T>(cross_account_id),
-			}
+			Self::from_sub::<T>(cross_account_id.as_sub())
 		} else {
 			Self {
 				eth: *cross_account_id.as_eth(),
modifiedpallets/evm-contract-helpers/Cargo.tomldiffbeforeafterboth
--- a/pallets/evm-contract-helpers/Cargo.toml
+++ b/pallets/evm-contract-helpers/Cargo.toml
@@ -50,6 +50,7 @@
     "pallet-evm-coder-substrate/std",
     "pallet-evm/std",
     "up-sponsorship/std",
+    "pallet-common/std",
 ]
 try-runtime = ["frame-support/try-runtime"]
-stubgen = ["evm-coder/stubgen"]
+stubgen = ["evm-coder/stubgen", "pallet-common/stubgen"]
modifiedpallets/evm-contract-helpers/src/eth.rsdiffbeforeafterboth
--- a/pallets/evm-contract-helpers/src/eth.rs
+++ b/pallets/evm-contract-helpers/src/eth.rs
@@ -175,18 +175,11 @@
 	///
 	/// @param contractAddress The contract for which a sponsor is requested.
 	/// @return Tuble with sponsor address and his substrate mirror. If there is no confirmed sponsor error "Contract has no sponsor" throw.
-	fn sponsor(&self, contract_address: address) -> Result<(address, uint256)> {
-		let sponsor =
-			Pallet::<T>::get_sponsor(contract_address).ok_or("Contract has no sponsor")?;
-		Ok(pallet_common::eth::convert_cross_account_to_tuple::<T>(
-			&sponsor,
+	fn sponsor(&self, contract_address: address) -> Result<EthCrossAccount> {
+		Ok(EthCrossAccount::from_sub_cross_account::<T>(
+			&Pallet::<T>::get_sponsor(contract_address).ok_or("Contract has no sponsor")?,
 		))
 	}
-	// fn sponsor(&self, contract_address: address) -> Result<EthCrossAccount> {
-	// 	Ok(EthCrossAccount::from_sub_cross_account::<T>(
-	// 		&Pallet::<T>::get_sponsor(contract_address).ok_or("Contract has no sponsor")?,
-	// 	))
-	// }
 
 	/// Check tat contract has confirmed sponsor.
 	///
modifiedpallets/evm-contract-helpers/src/stubs/ContractHelpers.rawdiffbeforeafterboth

binary blob — no preview

modifiedpallets/evm-contract-helpers/src/stubs/ContractHelpers.soldiffbeforeafterboth
--- a/pallets/evm-contract-helpers/src/stubs/ContractHelpers.sol
+++ b/pallets/evm-contract-helpers/src/stubs/ContractHelpers.sol
@@ -96,11 +96,11 @@
 	/// @return Tuble with sponsor address and his substrate mirror. If there is no confirmed sponsor error "Contract has no sponsor" throw.
 	/// @dev EVM selector for this function is: 0x766c4f37,
 	///  or in textual repr: sponsor(address)
-	function sponsor(address contractAddress) public view returns (Tuple0 memory) {
+	function sponsor(address contractAddress) public view returns (EthCrossAccount memory) {
 		require(false, stub_error);
 		contractAddress;
 		dummy;
-		return Tuple0(0x0000000000000000000000000000000000000000, 0);
+		return EthCrossAccount(0x0000000000000000000000000000000000000000, 0);
 	}
 
 	/// Check tat contract has confirmed sponsor.
@@ -265,8 +265,8 @@
 	}
 }
 
-/// @dev anonymous struct
-struct Tuple0 {
-	address field_0;
-	uint256 field_1;
+/// @dev Cross account struct
+struct EthCrossAccount {
+	address eth;
+	uint256 sub;
 }
modifiedpallets/nonfungible/src/erc.rsdiffbeforeafterboth
--- a/pallets/nonfungible/src/erc.rs
+++ b/pallets/nonfungible/src/erc.rs
@@ -605,7 +605,7 @@
 		Ok(false)
 	}
 
-	/// @notice Function to mint token.
+	/// @notice Function to a mint token.
 	/// @param to The new owner
 	/// @return uint256 The id of the newly minted token
 	#[weight(<SelfWeightOf<T>>::create_item())]
@@ -618,7 +618,7 @@
 		Ok(token_id)
 	}
 
-	/// @notice Function to mint token.
+	/// @notice Function to a mint token.
 	/// @dev `tokenId` should be obtained with `nextTokenId` method,
 	///  unlike standard, you can't specify it manually
 	/// @param to The new owner
@@ -1070,7 +1070,7 @@
 		Ok(true)
 	}
 
-	/// @notice Function to mint token.
+	/// @notice Function to a mint token.
 	/// @param to The new owner crossAccountId
 	/// @param properties Properties of minted token
 	/// @return uint256 The id of the newly minted token
modifiedpallets/nonfungible/src/stubs/UniqueNFT.soldiffbeforeafterboth
--- a/pallets/nonfungible/src/stubs/UniqueNFT.sol
+++ b/pallets/nonfungible/src/stubs/UniqueNFT.sol
@@ -738,7 +738,7 @@
 		return false;
 	}
 
-	/// @notice Function to mint token.
+	/// @notice Function to a mint token.
 	/// @param to The new owner
 	/// @return uint256 The id of the newly minted token
 	/// @dev EVM selector for this function is: 0x6a627842,
@@ -750,7 +750,7 @@
 		return 0;
 	}
 
-	// /// @notice Function to mint token.
+	// /// @notice Function to a mint token.
 	// /// @dev `tokenId` should be obtained with `nextTokenId` method,
 	// ///  unlike standard, you can't specify it manually
 	// /// @param to The new owner
@@ -995,7 +995,7 @@
 	// 	return false;
 	// }
 
-	/// @notice Function to mint token.
+	/// @notice Function to a mint token.
 	/// @param to The new owner crossAccountId
 	/// @param properties Properties of minted token
 	/// @return uint256 The id of the newly minted token
modifiedpallets/refungible/src/erc.rsdiffbeforeafterboth
--- a/pallets/refungible/src/erc.rs
+++ b/pallets/refungible/src/erc.rs
@@ -637,7 +637,7 @@
 		Ok(false)
 	}
 
-	/// @notice Function to mint token.
+	/// @notice Function to a mint token.
 	/// @param to The new owner
 	/// @return uint256 The id of the newly minted token
 	#[weight(<SelfWeightOf<T>>::create_item())]
@@ -650,7 +650,7 @@
 		Ok(token_id)
 	}
 
-	/// @notice Function to mint token.
+	/// @notice Function to a mint token.
 	/// @dev `tokenId` should be obtained with `nextTokenId` method,
 	///  unlike standard, you can't specify it manually
 	/// @param to The new owner
@@ -1120,7 +1120,7 @@
 		Ok(true)
 	}
 
-	/// @notice Function to mint token.
+	/// @notice Function to a mint token.
 	/// @param to The new owner crossAccountId
 	/// @param properties Properties of minted token
 	/// @return uint256 The id of the newly minted token
modifiedpallets/refungible/src/stubs/UniqueRefungible.soldiffbeforeafterboth
--- a/pallets/refungible/src/stubs/UniqueRefungible.sol
+++ b/pallets/refungible/src/stubs/UniqueRefungible.sol
@@ -733,7 +733,7 @@
 		return false;
 	}
 
-	/// @notice Function to mint token.
+	/// @notice Function to a mint token.
 	/// @param to The new owner
 	/// @return uint256 The id of the newly minted token
 	/// @dev EVM selector for this function is: 0x6a627842,
@@ -745,7 +745,7 @@
 		return 0;
 	}
 
-	// /// @notice Function to mint token.
+	// /// @notice Function to a mint token.
 	// /// @dev `tokenId` should be obtained with `nextTokenId` method,
 	// ///  unlike standard, you can't specify it manually
 	// /// @param to The new owner
@@ -979,7 +979,7 @@
 	// 	return false;
 	// }
 
-	/// @notice Function to mint token.
+	/// @notice Function to a mint token.
 	/// @param to The new owner crossAccountId
 	/// @param properties Properties of minted token
 	/// @return uint256 The id of the newly minted token
modifiedtests/src/eth/abi/contractHelpers.jsondiffbeforeafterboth
--- a/tests/src/eth/abi/contractHelpers.json
+++ b/tests/src/eth/abi/contractHelpers.json
@@ -223,10 +223,10 @@
     "outputs": [
       {
         "components": [
-          { "internalType": "address", "name": "field_0", "type": "address" },
-          { "internalType": "uint256", "name": "field_1", "type": "uint256" }
+          { "internalType": "address", "name": "eth", "type": "address" },
+          { "internalType": "uint256", "name": "sub", "type": "uint256" }
         ],
-        "internalType": "struct Tuple0",
+        "internalType": "struct EthCrossAccount",
         "name": "",
         "type": "tuple"
       }
modifiedtests/src/eth/api/ContractHelpers.soldiffbeforeafterboth
before · tests/src/eth/api/ContractHelpers.sol
1// SPDX-License-Identifier: OTHER2// This code is automatically generated34pragma solidity >=0.8.0 <0.9.0;56/// @dev common stubs holder7interface Dummy {89}1011interface ERC165 is Dummy {12	function supportsInterface(bytes4 interfaceID) external view returns (bool);13}1415/// @dev inlined interface16interface ContractHelpersEvents {17	event ContractSponsorSet(address indexed contractAddress, address sponsor);18	event ContractSponsorshipConfirmed(address indexed contractAddress, address sponsor);19	event ContractSponsorRemoved(address indexed contractAddress);20}2122/// @title Magic contract, which allows users to reconfigure other contracts23/// @dev the ERC-165 identifier for this interface is 0x30afad0424interface ContractHelpers is Dummy, ERC165, ContractHelpersEvents {25	/// Get user, which deployed specified contract26	/// @dev May return zero address in case if contract is deployed27	///  using uniquenetwork evm-migration pallet, or using other terms not28	///  intended by pallet-evm29	/// @dev Returns zero address if contract does not exists30	/// @param contractAddress Contract to get owner of31	/// @return address Owner of contract32	/// @dev EVM selector for this function is: 0x5152b14c,33	///  or in textual repr: contractOwner(address)34	function contractOwner(address contractAddress) external view returns (address);3536	/// Set sponsor.37	/// @param contractAddress Contract for which a sponsor is being established.38	/// @param sponsor User address who set as pending sponsor.39	/// @dev EVM selector for this function is: 0xf01fba93,40	///  or in textual repr: setSponsor(address,address)41	function setSponsor(address contractAddress, address sponsor) external;4243	/// Set contract as self sponsored.44	///45	/// @param contractAddress Contract for which a self sponsoring is being enabled.46	/// @dev EVM selector for this function is: 0x89f7d9ae,47	///  or in textual repr: selfSponsoredEnable(address)48	function selfSponsoredEnable(address contractAddress) external;4950	/// Remove sponsor.51	///52	/// @param contractAddress Contract for which a sponsorship is being removed.53	/// @dev EVM selector for this function is: 0xef784250,54	///  or in textual repr: removeSponsor(address)55	function removeSponsor(address contractAddress) external;5657	/// Confirm sponsorship.58	///59	/// @dev Caller must be same that set via [`setSponsor`].60	///61	/// @param contractAddress Сontract for which need to confirm sponsorship.62	/// @dev EVM selector for this function is: 0xabc00001,63	///  or in textual repr: confirmSponsorship(address)64	function confirmSponsorship(address contractAddress) external;6566	/// Get current sponsor.67	///68	/// @param contractAddress The contract for which a sponsor is requested.69	/// @return Tuble with sponsor address and his substrate mirror. If there is no confirmed sponsor error "Contract has no sponsor" throw.70	/// @dev EVM selector for this function is: 0x766c4f37,71	///  or in textual repr: sponsor(address)72	function sponsor(address contractAddress) external view returns (Tuple0 memory);7374	/// Check tat contract has confirmed sponsor.75	///76	/// @param contractAddress The contract for which the presence of a confirmed sponsor is checked.77	/// @return **true** if contract has confirmed sponsor.78	/// @dev EVM selector for this function is: 0x97418603,79	///  or in textual repr: hasSponsor(address)80	function hasSponsor(address contractAddress) external view returns (bool);8182	/// Check tat contract has pending sponsor.83	///84	/// @param contractAddress The contract for which the presence of a pending sponsor is checked.85	/// @return **true** if contract has pending sponsor.86	/// @dev EVM selector for this function is: 0x39b9b242,87	///  or in textual repr: hasPendingSponsor(address)88	function hasPendingSponsor(address contractAddress) external view returns (bool);8990	/// @dev EVM selector for this function is: 0x6027dc61,91	///  or in textual repr: sponsoringEnabled(address)92	function sponsoringEnabled(address contractAddress) external view returns (bool);9394	/// @dev EVM selector for this function is: 0xfde8a560,95	///  or in textual repr: setSponsoringMode(address,uint8)96	function setSponsoringMode(address contractAddress, uint8 mode) external;9798	/// Get current contract sponsoring rate limit99	/// @param contractAddress Contract to get sponsoring rate limit of100	/// @return uint32 Amount of blocks between two sponsored transactions101	/// @dev EVM selector for this function is: 0xf29694d8,102	///  or in textual repr: sponsoringRateLimit(address)103	function sponsoringRateLimit(address contractAddress) external view returns (uint32);104105	/// Set contract sponsoring rate limit106	/// @dev Sponsoring rate limit - is a minimum amount of blocks that should107	///  pass between two sponsored transactions108	/// @param contractAddress Contract to change sponsoring rate limit of109	/// @param rateLimit Target rate limit110	/// @dev Only contract owner can change this setting111	/// @dev EVM selector for this function is: 0x77b6c908,112	///  or in textual repr: setSponsoringRateLimit(address,uint32)113	function setSponsoringRateLimit(address contractAddress, uint32 rateLimit) external;114115	/// Set contract sponsoring fee limit116	/// @dev Sponsoring fee limit - is maximum fee that could be spent by117	///  single transaction118	/// @param contractAddress Contract to change sponsoring fee limit of119	/// @param feeLimit Fee limit120	/// @dev Only contract owner can change this setting121	/// @dev EVM selector for this function is: 0x03aed665,122	///  or in textual repr: setSponsoringFeeLimit(address,uint256)123	function setSponsoringFeeLimit(address contractAddress, uint256 feeLimit) external;124125	/// Get current contract sponsoring fee limit126	/// @param contractAddress Contract to get sponsoring fee limit of127	/// @return uint256 Maximum amount of fee that could be spent by single128	///  transaction129	/// @dev EVM selector for this function is: 0x75b73606,130	///  or in textual repr: sponsoringFeeLimit(address)131	function sponsoringFeeLimit(address contractAddress) external view returns (uint256);132133	/// Is specified user present in contract allow list134	/// @dev Contract owner always implicitly included135	/// @param contractAddress Contract to check allowlist of136	/// @param user User to check137	/// @return bool Is specified users exists in contract allowlist138	/// @dev EVM selector for this function is: 0x5c658165,139	///  or in textual repr: allowed(address,address)140	function allowed(address contractAddress, address user) external view returns (bool);141142	/// Toggle user presence in contract allowlist143	/// @param contractAddress Contract to change allowlist of144	/// @param user Which user presence should be toggled145	/// @param isAllowed `true` if user should be allowed to be sponsored146	///  or call this contract, `false` otherwise147	/// @dev Only contract owner can change this setting148	/// @dev EVM selector for this function is: 0x4706cc1c,149	///  or in textual repr: toggleAllowed(address,address,bool)150	function toggleAllowed(151		address contractAddress,152		address user,153		bool isAllowed154	) external;155156	/// Is this contract has allowlist access enabled157	/// @dev Allowlist always can have users, and it is used for two purposes:158	///  in case of allowlist sponsoring mode, users will be sponsored if they exist in allowlist159	///  in case of allowlist access enabled, only users from allowlist may call this contract160	/// @param contractAddress Contract to get allowlist access of161	/// @return bool Is specified contract has allowlist access enabled162	/// @dev EVM selector for this function is: 0xc772ef6c,163	///  or in textual repr: allowlistEnabled(address)164	function allowlistEnabled(address contractAddress) external view returns (bool);165166	/// Toggle contract allowlist access167	/// @param contractAddress Contract to change allowlist access of168	/// @param enabled Should allowlist access to be enabled?169	/// @dev EVM selector for this function is: 0x36de20f5,170	///  or in textual repr: toggleAllowlist(address,bool)171	function toggleAllowlist(address contractAddress, bool enabled) external;172}173174/// @dev anonymous struct175struct Tuple0 {176	address field_0;177	uint256 field_1;178}
after · tests/src/eth/api/ContractHelpers.sol
1// SPDX-License-Identifier: OTHER2// This code is automatically generated34pragma solidity >=0.8.0 <0.9.0;56/// @dev common stubs holder7interface Dummy {89}1011interface ERC165 is Dummy {12	function supportsInterface(bytes4 interfaceID) external view returns (bool);13}1415/// @dev inlined interface16interface ContractHelpersEvents {17	event ContractSponsorSet(address indexed contractAddress, address sponsor);18	event ContractSponsorshipConfirmed(address indexed contractAddress, address sponsor);19	event ContractSponsorRemoved(address indexed contractAddress);20}2122/// @title Magic contract, which allows users to reconfigure other contracts23/// @dev the ERC-165 identifier for this interface is 0x30afad0424interface ContractHelpers is Dummy, ERC165, ContractHelpersEvents {25	/// Get user, which deployed specified contract26	/// @dev May return zero address in case if contract is deployed27	///  using uniquenetwork evm-migration pallet, or using other terms not28	///  intended by pallet-evm29	/// @dev Returns zero address if contract does not exists30	/// @param contractAddress Contract to get owner of31	/// @return address Owner of contract32	/// @dev EVM selector for this function is: 0x5152b14c,33	///  or in textual repr: contractOwner(address)34	function contractOwner(address contractAddress) external view returns (address);3536	/// Set sponsor.37	/// @param contractAddress Contract for which a sponsor is being established.38	/// @param sponsor User address who set as pending sponsor.39	/// @dev EVM selector for this function is: 0xf01fba93,40	///  or in textual repr: setSponsor(address,address)41	function setSponsor(address contractAddress, address sponsor) external;4243	/// Set contract as self sponsored.44	///45	/// @param contractAddress Contract for which a self sponsoring is being enabled.46	/// @dev EVM selector for this function is: 0x89f7d9ae,47	///  or in textual repr: selfSponsoredEnable(address)48	function selfSponsoredEnable(address contractAddress) external;4950	/// Remove sponsor.51	///52	/// @param contractAddress Contract for which a sponsorship is being removed.53	/// @dev EVM selector for this function is: 0xef784250,54	///  or in textual repr: removeSponsor(address)55	function removeSponsor(address contractAddress) external;5657	/// Confirm sponsorship.58	///59	/// @dev Caller must be same that set via [`setSponsor`].60	///61	/// @param contractAddress Сontract for which need to confirm sponsorship.62	/// @dev EVM selector for this function is: 0xabc00001,63	///  or in textual repr: confirmSponsorship(address)64	function confirmSponsorship(address contractAddress) external;6566	/// Get current sponsor.67	///68	/// @param contractAddress The contract for which a sponsor is requested.69	/// @return Tuble with sponsor address and his substrate mirror. If there is no confirmed sponsor error "Contract has no sponsor" throw.70	/// @dev EVM selector for this function is: 0x766c4f37,71	///  or in textual repr: sponsor(address)72	function sponsor(address contractAddress) external view returns (EthCrossAccount memory);7374	/// Check tat contract has confirmed sponsor.75	///76	/// @param contractAddress The contract for which the presence of a confirmed sponsor is checked.77	/// @return **true** if contract has confirmed sponsor.78	/// @dev EVM selector for this function is: 0x97418603,79	///  or in textual repr: hasSponsor(address)80	function hasSponsor(address contractAddress) external view returns (bool);8182	/// Check tat contract has pending sponsor.83	///84	/// @param contractAddress The contract for which the presence of a pending sponsor is checked.85	/// @return **true** if contract has pending sponsor.86	/// @dev EVM selector for this function is: 0x39b9b242,87	///  or in textual repr: hasPendingSponsor(address)88	function hasPendingSponsor(address contractAddress) external view returns (bool);8990	/// @dev EVM selector for this function is: 0x6027dc61,91	///  or in textual repr: sponsoringEnabled(address)92	function sponsoringEnabled(address contractAddress) external view returns (bool);9394	/// @dev EVM selector for this function is: 0xfde8a560,95	///  or in textual repr: setSponsoringMode(address,uint8)96	function setSponsoringMode(address contractAddress, uint8 mode) external;9798	/// Get current contract sponsoring rate limit99	/// @param contractAddress Contract to get sponsoring rate limit of100	/// @return uint32 Amount of blocks between two sponsored transactions101	/// @dev EVM selector for this function is: 0xf29694d8,102	///  or in textual repr: sponsoringRateLimit(address)103	function sponsoringRateLimit(address contractAddress) external view returns (uint32);104105	/// Set contract sponsoring rate limit106	/// @dev Sponsoring rate limit - is a minimum amount of blocks that should107	///  pass between two sponsored transactions108	/// @param contractAddress Contract to change sponsoring rate limit of109	/// @param rateLimit Target rate limit110	/// @dev Only contract owner can change this setting111	/// @dev EVM selector for this function is: 0x77b6c908,112	///  or in textual repr: setSponsoringRateLimit(address,uint32)113	function setSponsoringRateLimit(address contractAddress, uint32 rateLimit) external;114115	/// Set contract sponsoring fee limit116	/// @dev Sponsoring fee limit - is maximum fee that could be spent by117	///  single transaction118	/// @param contractAddress Contract to change sponsoring fee limit of119	/// @param feeLimit Fee limit120	/// @dev Only contract owner can change this setting121	/// @dev EVM selector for this function is: 0x03aed665,122	///  or in textual repr: setSponsoringFeeLimit(address,uint256)123	function setSponsoringFeeLimit(address contractAddress, uint256 feeLimit) external;124125	/// Get current contract sponsoring fee limit126	/// @param contractAddress Contract to get sponsoring fee limit of127	/// @return uint256 Maximum amount of fee that could be spent by single128	///  transaction129	/// @dev EVM selector for this function is: 0x75b73606,130	///  or in textual repr: sponsoringFeeLimit(address)131	function sponsoringFeeLimit(address contractAddress) external view returns (uint256);132133	/// Is specified user present in contract allow list134	/// @dev Contract owner always implicitly included135	/// @param contractAddress Contract to check allowlist of136	/// @param user User to check137	/// @return bool Is specified users exists in contract allowlist138	/// @dev EVM selector for this function is: 0x5c658165,139	///  or in textual repr: allowed(address,address)140	function allowed(address contractAddress, address user) external view returns (bool);141142	/// Toggle user presence in contract allowlist143	/// @param contractAddress Contract to change allowlist of144	/// @param user Which user presence should be toggled145	/// @param isAllowed `true` if user should be allowed to be sponsored146	///  or call this contract, `false` otherwise147	/// @dev Only contract owner can change this setting148	/// @dev EVM selector for this function is: 0x4706cc1c,149	///  or in textual repr: toggleAllowed(address,address,bool)150	function toggleAllowed(151		address contractAddress,152		address user,153		bool isAllowed154	) external;155156	/// Is this contract has allowlist access enabled157	/// @dev Allowlist always can have users, and it is used for two purposes:158	///  in case of allowlist sponsoring mode, users will be sponsored if they exist in allowlist159	///  in case of allowlist access enabled, only users from allowlist may call this contract160	/// @param contractAddress Contract to get allowlist access of161	/// @return bool Is specified contract has allowlist access enabled162	/// @dev EVM selector for this function is: 0xc772ef6c,163	///  or in textual repr: allowlistEnabled(address)164	function allowlistEnabled(address contractAddress) external view returns (bool);165166	/// Toggle contract allowlist access167	/// @param contractAddress Contract to change allowlist access of168	/// @param enabled Should allowlist access to be enabled?169	/// @dev EVM selector for this function is: 0x36de20f5,170	///  or in textual repr: toggleAllowlist(address,bool)171	function toggleAllowlist(address contractAddress, bool enabled) external;172}173174/// @dev Cross account struct175struct EthCrossAccount {176	address eth;177	uint256 sub;178}
modifiedtests/src/eth/api/UniqueNFT.soldiffbeforeafterboth
--- a/tests/src/eth/api/UniqueNFT.sol
+++ b/tests/src/eth/api/UniqueNFT.sol
@@ -515,14 +515,14 @@
 	///  or in textual repr: mintingFinished()
 	function mintingFinished() external view returns (bool);
 
-	/// @notice Function to mint token.
+	/// @notice Function to a mint token.
 	/// @param to The new owner
 	/// @return uint256 The id of the newly minted token
 	/// @dev EVM selector for this function is: 0x6a627842,
 	///  or in textual repr: mint(address)
 	function mint(address to) external returns (uint256);
 
-	// /// @notice Function to mint token.
+	// /// @notice Function to a mint token.
 	// /// @dev `tokenId` should be obtained with `nextTokenId` method,
 	// ///  unlike standard, you can't specify it manually
 	// /// @param to The new owner
@@ -674,7 +674,7 @@
 	// ///  or in textual repr: mintBulkWithTokenURI(address,(uint256,string)[])
 	// function mintBulkWithTokenURI(address to, Tuple13[] memory tokens) external returns (bool);
 
-	/// @notice Function to mint token.
+	/// @notice Function to a mint token.
 	/// @param to The new owner crossAccountId
 	/// @param properties Properties of minted token
 	/// @return uint256 The id of the newly minted token
modifiedtests/src/eth/api/UniqueRefungible.soldiffbeforeafterboth
--- a/tests/src/eth/api/UniqueRefungible.sol
+++ b/tests/src/eth/api/UniqueRefungible.sol
@@ -513,14 +513,14 @@
 	///  or in textual repr: mintingFinished()
 	function mintingFinished() external view returns (bool);
 
-	/// @notice Function to mint token.
+	/// @notice Function to a mint token.
 	/// @param to The new owner
 	/// @return uint256 The id of the newly minted token
 	/// @dev EVM selector for this function is: 0x6a627842,
 	///  or in textual repr: mint(address)
 	function mint(address to) external returns (uint256);
 
-	// /// @notice Function to mint token.
+	// /// @notice Function to a mint token.
 	// /// @dev `tokenId` should be obtained with `nextTokenId` method,
 	// ///  unlike standard, you can't specify it manually
 	// /// @param to The new owner
@@ -666,7 +666,7 @@
 	// ///  or in textual repr: mintBulkWithTokenURI(address,(uint256,string)[])
 	// function mintBulkWithTokenURI(address to, Tuple12[] memory tokens) external returns (bool);
 
-	/// @notice Function to mint token.
+	/// @notice Function to a mint token.
 	/// @param to The new owner crossAccountId
 	/// @param properties Properties of minted token
 	/// @return uint256 The id of the newly minted token
modifiedtests/src/eth/nonFungible.test.tsdiffbeforeafterboth
--- a/tests/src/eth/nonFungible.test.ts
+++ b/tests/src/eth/nonFungible.test.ts
@@ -17,7 +17,6 @@
 import {itEth, usingEthPlaygrounds, expect, EthUniqueHelper} from './util';
 import {IKeyringPair} from '@polkadot/types/types';
 import {Contract} from 'web3-eth-contract';
-import exp from 'constants';
 import {ITokenPropertyPermission} from '../util/playgrounds/types';
 
 
@@ -180,9 +179,16 @@
     const caller = await helper.eth.createAccountWithBalance(donor);
     const receiverCross = helper.ethCrossAccount.fromKeyringPair(bob);
     const properties = Array(5).fill(0).map((_, i) => { return {key: `key_${i}`, value: Buffer.from(`value_${i}`)}; });
-    const permissions: ITokenPropertyPermission[] = properties.map(p => { return {key: p.key, permission: {tokenOwner: true,
-      collectionAdmin: true,
-      mutable: true}}; });
+    const permissions: ITokenPropertyPermission[] = properties
+      .map(p => {
+        return {
+          key: p.key, permission: {
+            tokenOwner: true,
+            collectionAdmin: true,
+            mutable: true,
+          },
+        };
+      });
     
     
     const collection = await helper.nft.mintCollection(minter, {
@@ -198,7 +204,7 @@
     let tokenId = result.events.Transfer.returnValues.tokenId;
     expect(tokenId).to.be.equal(expectedTokenId);
 
-    const event = result.events.Transfer;
+    let event = result.events.Transfer;
     expect(event.address).to.be.equal(collectionAddress);
     expect(event.returnValues.from).to.be.equal('0x0000000000000000000000000000000000000000');
     expect(event.returnValues.to).to.be.equal(helper.address.substrateToEth(bob.address));
@@ -206,10 +212,16 @@
     
     expectedTokenId = await contract.methods.nextTokenId().call();
     result = await contract.methods.mintCross(receiverCross, properties).send();
+    event = result.events.Transfer;
+    expect(event.address).to.be.equal(collectionAddress);
+    expect(event.returnValues.from).to.be.equal('0x0000000000000000000000000000000000000000');
+    expect(event.returnValues.to).to.be.equal(helper.address.substrateToEth(bob.address));
+    expect(await contract.methods.properties(tokenId, []).call()).to.be.like([]);
+    
     tokenId = result.events.Transfer.returnValues.tokenId;
-
+    
     expect(tokenId).to.be.equal(expectedTokenId);
-    
+
     expect(await contract.methods.properties(tokenId, []).call()).to.be.like(properties
       .map(p => { return helper.ethProperty.property(p.key, p.value.toString()); }));
   });
modifiedtests/src/eth/reFungible.test.tsdiffbeforeafterboth
--- a/tests/src/eth/reFungible.test.ts
+++ b/tests/src/eth/reFungible.test.ts
@@ -17,7 +17,7 @@
 import {Pallets, requirePalletsOrSkip} from '../util';
 import {expect, itEth, usingEthPlaygrounds} from './util';
 import {IKeyringPair} from '@polkadot/types/types';
-import { ITokenPropertyPermission } from '../util/playgrounds/types';
+import {ITokenPropertyPermission} from '../util/playgrounds/types';
 
 describe('Refungible: Information getting', () => {
   let donor: IKeyringPair;
@@ -159,7 +159,7 @@
     let tokenId = result.events.Transfer.returnValues.tokenId;
     expect(tokenId).to.be.equal(expectedTokenId);
 
-    const event = result.events.Transfer;
+    let event = result.events.Transfer;
     expect(event.address).to.be.equal(collectionAddress);
     expect(event.returnValues.from).to.be.equal('0x0000000000000000000000000000000000000000');
     expect(event.returnValues.to).to.be.equal(helper.address.substrateToEth(bob.address));
@@ -167,6 +167,12 @@
     
     expectedTokenId = await contract.methods.nextTokenId().call();
     result = await contract.methods.mintCross(receiverCross, properties).send();
+    event = result.events.Transfer;
+    expect(event.address).to.be.equal(collectionAddress);
+    expect(event.returnValues.from).to.be.equal('0x0000000000000000000000000000000000000000');
+    expect(event.returnValues.to).to.be.equal(helper.address.substrateToEth(bob.address));
+    expect(await contract.methods.properties(tokenId, []).call()).to.be.like([]);
+    
     tokenId = result.events.Transfer.returnValues.tokenId;
 
     expect(tokenId).to.be.equal(expectedTokenId);