git.delta.rocks / unique-network / refs/commits / f9d5d231c21a

difftreelog

path: add stubs

Trubnikov Sergey2022-08-05parent: #0285730.patch.diff
in: master

3 files changed

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
@@ -21,8 +21,16 @@
 	}
 }
 
+<<<<<<< HEAD
 /// @title Magic contract, which allows users to reconfigure other contracts
 /// @dev the ERC-165 identifier for this interface is 0xd77fab70
+=======
+<<<<<<< HEAD
+// Selector: 6073d917
+=======
+// Selector: 06fc42e9
+>>>>>>> path: add stubs
+>>>>>>> path: add stubs
 contract ContractHelpers is Dummy, ERC165 {
 	/// Get user, which deployed specified contract
 	/// @dev May return zero address in case if contract is deployed
@@ -44,11 +52,23 @@
 		return 0x0000000000000000000000000000000000000000;
 	}
 
+<<<<<<< HEAD
 	/// Set sponsor.
 	/// @param contractAddress Contract for which a sponsor is being established.
 	/// @param sponsor User address who set as pending sponsor.
 	/// @dev EVM selector for this function is: 0xf01fba93,
 	///  or in textual repr: setSponsor(address,address)
+=======
+<<<<<<< HEAD
+	// Set sponsor.
+	//
+	// @param contract_address Contract for which a sponsor is being established.
+	// @param sponsor User address who set as pending sponsor.
+	//
+=======
+>>>>>>> path: add stubs
+	// Selector: setSponsor(address,address) f01fba93
+>>>>>>> path: add stubs
 	function setSponsor(address contractAddress, address sponsor) public {
 		require(false, stub_error);
 		contractAddress;
@@ -56,22 +76,44 @@
 		dummy = 0;
 	}
 
+<<<<<<< HEAD
 	/// Set contract as self sponsored.
 	///
 	/// @param contractAddress Contract for which a self sponsoring is being enabled.
 	/// @dev EVM selector for this function is: 0x89f7d9ae,
 	///  or in textual repr: selfSponsoredEnable(address)
+=======
+<<<<<<< HEAD
+	// Set contract as self sponsored.
+	//
+	// @param contract_address Contract for which a self sponsoring is being enabled.
+	//
+	// Selector: selfSponsoredEnable(address) 89f7d9ae
+>>>>>>> path: add stubs
 	function selfSponsoredEnable(address contractAddress) public {
+=======
+	// Selector: confirmSponsorship(address) abc00001
+	function confirmSponsorship(address contractAddress) public {
+>>>>>>> path: add stubs
 		require(false, stub_error);
 		contractAddress;
 		dummy = 0;
 	}
 
+<<<<<<< HEAD
 	/// Remove sponsor.
 	///
 	/// @param contractAddress Contract for which a sponsorship is being removed.
 	/// @dev EVM selector for this function is: 0xef784250,
 	///  or in textual repr: removeSponsor(address)
+=======
+<<<<<<< HEAD
+	// Remove sponsor.
+	//
+	// @param contract_address Contract for which a sponsorship is being removed.
+	//
+	// Selector: removeSponsor(address) ef784250
+>>>>>>> path: add stubs
 	function removeSponsor(address contractAddress) public {
 		require(false, stub_error);
 		contractAddress;
@@ -98,6 +140,9 @@
 	/// @dev EVM selector for this function is: 0x743fc745,
 	///  or in textual repr: getSponsor(address)
 	function getSponsor(address contractAddress)
+=======
+	// Selector: getSponsor(address) 743fc745
+	function getSponsor(address contractAddress)
 		public
 		view
 		returns (Tuple0 memory)
@@ -108,6 +153,27 @@
 		return Tuple0(0x0000000000000000000000000000000000000000, 0);
 	}
 
+	// Selector: hasSponsor(address) 97418603
+	function hasSponsor(address contractAddress) public view returns (bool) {
+		require(false, stub_error);
+		contractAddress;
+		dummy;
+		return false;
+	}
+
+	// Selector: hasPendingSponsor(address) 39b9b242
+	function hasPendingSponsor(address contractAddress)
+>>>>>>> path: add stubs
+		public
+		view
+		returns (Tuple0 memory)
+	{
+		require(false, stub_error);
+		contractAddress;
+		dummy;
+		return Tuple0(0x0000000000000000000000000000000000000000, 0);
+	}
+
 	/// Check tat contract has confirmed sponsor.
 	///
 	/// @param contractAddress The contract for which the presence of a confirmed sponsor is checked.
@@ -121,13 +187,27 @@
 		return false;
 	}
 
+<<<<<<< HEAD
 	/// Check tat contract has pending sponsor.
 	///
 	/// @param contractAddress The contract for which the presence of a pending sponsor is checked.
 	/// @return **true** if contract has pending sponsor.
 	/// @dev EVM selector for this function is: 0x39b9b242,
 	///  or in textual repr: hasPendingSponsor(address)
+=======
+<<<<<<< HEAD
+	// Check tat contract has pending sponsor.
+	//
+	// @param contract_address The contract for which the presence of a pending sponsor is checked.
+	// @return **true** if contract has pending sponsor.
+	//
+	// Selector: hasPendingSponsor(address) 39b9b242
+>>>>>>> path: add stubs
 	function hasPendingSponsor(address contractAddress)
+=======
+	// Selector: sponsoringEnabled(address) 6027dc61
+	function sponsoringEnabled(address contractAddress)
+>>>>>>> path: add stubs
 		public
 		view
 		returns (bool)
@@ -136,6 +216,7 @@
 		contractAddress;
 		dummy;
 		return false;
+<<<<<<< HEAD
 	}
 
 	/// @dev EVM selector for this function is: 0x6027dc61,
@@ -149,6 +230,8 @@
 		contractAddress;
 		dummy;
 		return false;
+=======
+>>>>>>> path: add stubs
 	}
 
 	/// @dev EVM selector for this function is: 0xfde8a560,
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/// @title Magic contract, which allows users to reconfigure other contracts16/// @dev the ERC-165 identifier for this interface is 0xd77fab7017interface ContractHelpers is Dummy, ERC165 {18	/// Get user, which deployed specified contract19	/// @dev May return zero address in case if contract is deployed20	///  using uniquenetwork evm-migration pallet, or using other terms not21	///  intended by pallet-evm22	/// @dev Returns zero address if contract does not exists23	/// @param contractAddress Contract to get owner of24	/// @return address Owner of contract25	/// @dev EVM selector for this function is: 0x5152b14c,26	///  or in textual repr: contractOwner(address)27	function contractOwner(address contractAddress)28		external29		view30		returns (address);3132	/// Set sponsor.33	/// @param contractAddress Contract for which a sponsor is being established.34	/// @param sponsor User address who set as pending sponsor.35	/// @dev EVM selector for this function is: 0xf01fba93,36	///  or in textual repr: setSponsor(address,address)37	function setSponsor(address contractAddress, address sponsor) external;3839	/// Set contract as self sponsored.40	///41	/// @param contractAddress Contract for which a self sponsoring is being enabled.42	/// @dev EVM selector for this function is: 0x89f7d9ae,43	///  or in textual repr: selfSponsoredEnable(address)44	function selfSponsoredEnable(address contractAddress) external;4546	/// Remove sponsor.47	///48	/// @param contractAddress Contract for which a sponsorship is being removed.49	/// @dev EVM selector for this function is: 0xef784250,50	///  or in textual repr: removeSponsor(address)51	function removeSponsor(address contractAddress) external;5253	/// Confirm sponsorship.54	///55	/// @dev Caller must be same that set via [`setSponsor`].56	///57	/// @param contractAddress Сontract for which need to confirm sponsorship.58	/// @dev EVM selector for this function is: 0xabc00001,59	///  or in textual repr: confirmSponsorship(address)60	function confirmSponsorship(address contractAddress) external;6162	/// Get current sponsor.63	///64	/// @param contractAddress The contract for which a sponsor is requested.65	/// @return Tuble with sponsor address and his substrate mirror. If there is no confirmed sponsor error "Contract has no sponsor" throw.66	/// @dev EVM selector for this function is: 0x743fc745,67	///  or in textual repr: getSponsor(address)68	function getSponsor(address contractAddress)69		external70		view71		returns (Tuple0 memory);7273	/// Check tat contract has confirmed sponsor.74	///75	/// @param contractAddress The contract for which the presence of a confirmed sponsor is checked.76	/// @return **true** if contract has confirmed sponsor.77	/// @dev EVM selector for this function is: 0x97418603,78	///  or in textual repr: hasSponsor(address)79	function hasSponsor(address contractAddress) external view returns (bool);8081	/// Check tat contract has pending sponsor.82	///83	/// @param contractAddress The contract for which the presence of a pending sponsor is checked.84	/// @return **true** if contract has pending sponsor.85	/// @dev EVM selector for this function is: 0x39b9b242,86	///  or in textual repr: hasPendingSponsor(address)87	function hasPendingSponsor(address contractAddress)88		external89		view90		returns (bool);9192	/// @dev EVM selector for this function is: 0x6027dc61,93	///  or in textual repr: sponsoringEnabled(address)94	function sponsoringEnabled(address contractAddress)95		external96		view97		returns (bool);9899	/// @dev EVM selector for this function is: 0xfde8a560,100	///  or in textual repr: setSponsoringMode(address,uint8)101	function setSponsoringMode(address contractAddress, uint8 mode) external;102103	/// Get current contract sponsoring rate limit104	/// @param contractAddress Contract to get sponsoring mode of105	/// @return uint32 Amount of blocks between two sponsored transactions106	/// @dev EVM selector for this function is: 0x610cfabd,107	///  or in textual repr: getSponsoringRateLimit(address)108	function getSponsoringRateLimit(address contractAddress)109		external110		view111		returns (uint32);112113	/// Set contract sponsoring rate limit114	/// @dev Sponsoring rate limit - is a minimum amount of blocks that should115	///  pass between two sponsored transactions116	/// @param contractAddress Contract to change sponsoring rate limit of117	/// @param rateLimit Target rate limit118	/// @dev Only contract owner can change this setting119	/// @dev EVM selector for this function is: 0x77b6c908,120	///  or in textual repr: setSponsoringRateLimit(address,uint32)121	function setSponsoringRateLimit(address contractAddress, uint32 rateLimit)122		external;123124	/// Is specified user present in contract allow list125	/// @dev Contract owner always implicitly included126	/// @param contractAddress Contract to check allowlist of127	/// @param user User to check128	/// @return bool Is specified users exists in contract allowlist129	/// @dev EVM selector for this function is: 0x5c658165,130	///  or in textual repr: allowed(address,address)131	function allowed(address contractAddress, address user)132		external133		view134		returns (bool);135136	/// Toggle user presence in contract allowlist137	/// @param contractAddress Contract to change allowlist of138	/// @param user Which user presence should be toggled139	/// @param isAllowed `true` if user should be allowed to be sponsored140	///  or call this contract, `false` otherwise141	/// @dev Only contract owner can change this setting142	/// @dev EVM selector for this function is: 0x4706cc1c,143	///  or in textual repr: toggleAllowed(address,address,bool)144	function toggleAllowed(145		address contractAddress,146		address user,147		bool isAllowed148	) external;149150	/// Is this contract has allowlist access enabled151	/// @dev Allowlist always can have users, and it is used for two purposes:152	///  in case of allowlist sponsoring mode, users will be sponsored if they exist in allowlist153	///  in case of allowlist access enabled, only users from allowlist may call this contract154	/// @param contractAddress Contract to get allowlist access of155	/// @return bool Is specified contract has allowlist access enabled156	/// @dev EVM selector for this function is: 0xc772ef6c,157	///  or in textual repr: allowlistEnabled(address)158	function allowlistEnabled(address contractAddress)159		external160		view161		returns (bool);162163	/// Toggle contract allowlist access164	/// @param contractAddress Contract to change allowlist access of165	/// @param enabled Should allowlist access to be enabled?166	/// @dev EVM selector for this function is: 0x36de20f5,167	///  or in textual repr: toggleAllowlist(address,bool)168	function toggleAllowlist(address contractAddress, bool enabled) external;169}170171/// @dev anonymous struct172struct Tuple0 {173	address field_0;174	uint256 field_1;175}
modifiedtests/src/eth/util/contractHelpersAbi.jsondiffbeforeafterboth
--- a/tests/src/eth/util/contractHelpersAbi.json
+++ b/tests/src/eth/util/contractHelpersAbi.json
@@ -120,6 +120,7 @@
         "internalType": "address",
         "name": "contractAddress",
         "type": "address"
+<<<<<<< HEAD
       }
     ],
     "name": "removeSponsor",
@@ -146,6 +147,8 @@
         "internalType": "address",
         "name": "contractAddress",
         "type": "address"
+=======
+>>>>>>> path: add stubs
       },
       { "internalType": "address", "name": "sponsor", "type": "address" }
     ],