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
before · pallets/evm-contract-helpers/src/stubs/ContractHelpers.sol
1// SPDX-License-Identifier: OTHER2// This code is automatically generated34pragma solidity >=0.8.0 <0.9.0;56/// @dev common stubs holder7contract Dummy {8	uint8 dummy;9	string stub_error = "this contract is implemented in native";10}1112contract ERC165 is Dummy {13	function supportsInterface(bytes4 interfaceID)14		external15		view16		returns (bool)17	{18		require(false, stub_error);19		interfaceID;20		return true;21	}22}2324/// @title Magic contract, which allows users to reconfigure other contracts25/// @dev the ERC-165 identifier for this interface is 0xd77fab7026contract ContractHelpers is Dummy, ERC165 {27	/// Get user, which deployed specified contract28	/// @dev May return zero address in case if contract is deployed29	///  using uniquenetwork evm-migration pallet, or using other terms not30	///  intended by pallet-evm31	/// @dev Returns zero address if contract does not exists32	/// @param contractAddress Contract to get owner of33	/// @return address Owner of contract34	/// @dev EVM selector for this function is: 0x5152b14c,35	///  or in textual repr: contractOwner(address)36	function contractOwner(address contractAddress)37		public38		view39		returns (address)40	{41		require(false, stub_error);42		contractAddress;43		dummy;44		return 0x0000000000000000000000000000000000000000;45	}4647	/// Set sponsor.48	/// @param contractAddress Contract for which a sponsor is being established.49	/// @param sponsor User address who set as pending sponsor.50	/// @dev EVM selector for this function is: 0xf01fba93,51	///  or in textual repr: setSponsor(address,address)52	function setSponsor(address contractAddress, address sponsor) public {53		require(false, stub_error);54		contractAddress;55		sponsor;56		dummy = 0;57	}5859	/// Set contract as self sponsored.60	///61	/// @param contractAddress Contract for which a self sponsoring is being enabled.62	/// @dev EVM selector for this function is: 0x89f7d9ae,63	///  or in textual repr: selfSponsoredEnable(address)64	function selfSponsoredEnable(address contractAddress) public {65		require(false, stub_error);66		contractAddress;67		dummy = 0;68	}6970	/// Remove sponsor.71	///72	/// @param contractAddress Contract for which a sponsorship is being removed.73	/// @dev EVM selector for this function is: 0xef784250,74	///  or in textual repr: removeSponsor(address)75	function removeSponsor(address contractAddress) public {76		require(false, stub_error);77		contractAddress;78		dummy = 0;79	}8081	/// Confirm sponsorship.82	///83	/// @dev Caller must be same that set via [`setSponsor`].84	///85	/// @param contractAddress Сontract for which need to confirm sponsorship.86	/// @dev EVM selector for this function is: 0xabc00001,87	///  or in textual repr: confirmSponsorship(address)88	function confirmSponsorship(address contractAddress) public {89		require(false, stub_error);90		contractAddress;91		dummy = 0;92	}9394	/// Get current sponsor.95	///96	/// @param contractAddress The contract for which a sponsor is requested.97	/// @return Tuble with sponsor address and his substrate mirror. If there is no confirmed sponsor error "Contract has no sponsor" throw.98	/// @dev EVM selector for this function is: 0x743fc745,99	///  or in textual repr: getSponsor(address)100	function getSponsor(address contractAddress)101		public102		view103		returns (Tuple0 memory)104	{105		require(false, stub_error);106		contractAddress;107		dummy;108		return Tuple0(0x0000000000000000000000000000000000000000, 0);109	}110111	/// Check tat contract has confirmed sponsor.112	///113	/// @param contractAddress The contract for which the presence of a confirmed sponsor is checked.114	/// @return **true** if contract has confirmed sponsor.115	/// @dev EVM selector for this function is: 0x97418603,116	///  or in textual repr: hasSponsor(address)117	function hasSponsor(address contractAddress) public view returns (bool) {118		require(false, stub_error);119		contractAddress;120		dummy;121		return false;122	}123124	/// Check tat contract has pending sponsor.125	///126	/// @param contractAddress The contract for which the presence of a pending sponsor is checked.127	/// @return **true** if contract has pending sponsor.128	/// @dev EVM selector for this function is: 0x39b9b242,129	///  or in textual repr: hasPendingSponsor(address)130	function hasPendingSponsor(address contractAddress)131		public132		view133		returns (bool)134	{135		require(false, stub_error);136		contractAddress;137		dummy;138		return false;139	}140141	/// @dev EVM selector for this function is: 0x6027dc61,142	///  or in textual repr: sponsoringEnabled(address)143	function sponsoringEnabled(address contractAddress)144		public145		view146		returns (bool)147	{148		require(false, stub_error);149		contractAddress;150		dummy;151		return false;152	}153154	/// @dev EVM selector for this function is: 0xfde8a560,155	///  or in textual repr: setSponsoringMode(address,uint8)156	function setSponsoringMode(address contractAddress, uint8 mode) public {157		require(false, stub_error);158		contractAddress;159		mode;160		dummy = 0;161	}162163	/// Get current contract sponsoring rate limit164	/// @param contractAddress Contract to get sponsoring mode of165	/// @return uint32 Amount of blocks between two sponsored transactions166	/// @dev EVM selector for this function is: 0x610cfabd,167	///  or in textual repr: getSponsoringRateLimit(address)168	function getSponsoringRateLimit(address contractAddress)169		public170		view171		returns (uint32)172	{173		require(false, stub_error);174		contractAddress;175		dummy;176		return 0;177	}178179	/// Set contract sponsoring rate limit180	/// @dev Sponsoring rate limit - is a minimum amount of blocks that should181	///  pass between two sponsored transactions182	/// @param contractAddress Contract to change sponsoring rate limit of183	/// @param rateLimit Target rate limit184	/// @dev Only contract owner can change this setting185	/// @dev EVM selector for this function is: 0x77b6c908,186	///  or in textual repr: setSponsoringRateLimit(address,uint32)187	function setSponsoringRateLimit(address contractAddress, uint32 rateLimit)188		public189	{190		require(false, stub_error);191		contractAddress;192		rateLimit;193		dummy = 0;194	}195196	/// Is specified user present in contract allow list197	/// @dev Contract owner always implicitly included198	/// @param contractAddress Contract to check allowlist of199	/// @param user User to check200	/// @return bool Is specified users exists in contract allowlist201	/// @dev EVM selector for this function is: 0x5c658165,202	///  or in textual repr: allowed(address,address)203	function allowed(address contractAddress, address user)204		public205		view206		returns (bool)207	{208		require(false, stub_error);209		contractAddress;210		user;211		dummy;212		return false;213	}214215	/// Toggle user presence in contract allowlist216	/// @param contractAddress Contract to change allowlist of217	/// @param user Which user presence should be toggled218	/// @param isAllowed `true` if user should be allowed to be sponsored219	///  or call this contract, `false` otherwise220	/// @dev Only contract owner can change this setting221	/// @dev EVM selector for this function is: 0x4706cc1c,222	///  or in textual repr: toggleAllowed(address,address,bool)223	function toggleAllowed(224		address contractAddress,225		address user,226		bool isAllowed227	) public {228		require(false, stub_error);229		contractAddress;230		user;231		isAllowed;232		dummy = 0;233	}234235	/// Is this contract has allowlist access enabled236	/// @dev Allowlist always can have users, and it is used for two purposes:237	///  in case of allowlist sponsoring mode, users will be sponsored if they exist in allowlist238	///  in case of allowlist access enabled, only users from allowlist may call this contract239	/// @param contractAddress Contract to get allowlist access of240	/// @return bool Is specified contract has allowlist access enabled241	/// @dev EVM selector for this function is: 0xc772ef6c,242	///  or in textual repr: allowlistEnabled(address)243	function allowlistEnabled(address contractAddress)244		public245		view246		returns (bool)247	{248		require(false, stub_error);249		contractAddress;250		dummy;251		return false;252	}253254	/// Toggle contract allowlist access255	/// @param contractAddress Contract to change allowlist access of256	/// @param enabled Should allowlist access to be enabled?257	/// @dev EVM selector for this function is: 0x36de20f5,258	///  or in textual repr: toggleAllowlist(address,bool)259	function toggleAllowlist(address contractAddress, bool enabled) public {260		require(false, stub_error);261		contractAddress;262		enabled;263		dummy = 0;264	}265}266267/// @dev anonymous struct268struct Tuple0 {269	address field_0;270	uint256 field_1;271}
after · pallets/evm-contract-helpers/src/stubs/ContractHelpers.sol
1// SPDX-License-Identifier: OTHER2// This code is automatically generated34pragma solidity >=0.8.0 <0.9.0;56/// @dev common stubs holder7contract Dummy {8	uint8 dummy;9	string stub_error = "this contract is implemented in native";10}1112contract ERC165 is Dummy {13	function supportsInterface(bytes4 interfaceID)14		external15		view16		returns (bool)17	{18		require(false, stub_error);19		interfaceID;20		return true;21	}22}2324<<<<<<< HEAD25/// @title Magic contract, which allows users to reconfigure other contracts26/// @dev the ERC-165 identifier for this interface is 0xd77fab7027=======28<<<<<<< HEAD29// Selector: 6073d91730=======31// Selector: 06fc42e932>>>>>>> path: add stubs33>>>>>>> path: add stubs34contract ContractHelpers is Dummy, ERC165 {35	/// Get user, which deployed specified contract36	/// @dev May return zero address in case if contract is deployed37	///  using uniquenetwork evm-migration pallet, or using other terms not38	///  intended by pallet-evm39	/// @dev Returns zero address if contract does not exists40	/// @param contractAddress Contract to get owner of41	/// @return address Owner of contract42	/// @dev EVM selector for this function is: 0x5152b14c,43	///  or in textual repr: contractOwner(address)44	function contractOwner(address contractAddress)45		public46		view47		returns (address)48	{49		require(false, stub_error);50		contractAddress;51		dummy;52		return 0x0000000000000000000000000000000000000000;53	}5455<<<<<<< HEAD56	/// Set sponsor.57	/// @param contractAddress Contract for which a sponsor is being established.58	/// @param sponsor User address who set as pending sponsor.59	/// @dev EVM selector for this function is: 0xf01fba93,60	///  or in textual repr: setSponsor(address,address)61=======62<<<<<<< HEAD63	// Set sponsor.64	//65	// @param contract_address Contract for which a sponsor is being established.66	// @param sponsor User address who set as pending sponsor.67	//68=======69>>>>>>> path: add stubs70	// Selector: setSponsor(address,address) f01fba9371>>>>>>> path: add stubs72	function setSponsor(address contractAddress, address sponsor) public {73		require(false, stub_error);74		contractAddress;75		sponsor;76		dummy = 0;77	}7879<<<<<<< HEAD80	/// Set contract as self sponsored.81	///82	/// @param contractAddress Contract for which a self sponsoring is being enabled.83	/// @dev EVM selector for this function is: 0x89f7d9ae,84	///  or in textual repr: selfSponsoredEnable(address)85=======86<<<<<<< HEAD87	// Set contract as self sponsored.88	//89	// @param contract_address Contract for which a self sponsoring is being enabled.90	//91	// Selector: selfSponsoredEnable(address) 89f7d9ae92>>>>>>> path: add stubs93	function selfSponsoredEnable(address contractAddress) public {94=======95	// Selector: confirmSponsorship(address) abc0000196	function confirmSponsorship(address contractAddress) public {97>>>>>>> path: add stubs98		require(false, stub_error);99		contractAddress;100		dummy = 0;101	}102103<<<<<<< HEAD104	/// Remove sponsor.105	///106	/// @param contractAddress Contract for which a sponsorship is being removed.107	/// @dev EVM selector for this function is: 0xef784250,108	///  or in textual repr: removeSponsor(address)109=======110<<<<<<< HEAD111	// Remove sponsor.112	//113	// @param contract_address Contract for which a sponsorship is being removed.114	//115	// Selector: removeSponsor(address) ef784250116>>>>>>> path: add stubs117	function removeSponsor(address contractAddress) public {118		require(false, stub_error);119		contractAddress;120		dummy = 0;121	}122123	/// Confirm sponsorship.124	///125	/// @dev Caller must be same that set via [`setSponsor`].126	///127	/// @param contractAddress Сontract for which need to confirm sponsorship.128	/// @dev EVM selector for this function is: 0xabc00001,129	///  or in textual repr: confirmSponsorship(address)130	function confirmSponsorship(address contractAddress) public {131		require(false, stub_error);132		contractAddress;133		dummy = 0;134	}135136	/// Get current sponsor.137	///138	/// @param contractAddress The contract for which a sponsor is requested.139	/// @return Tuble with sponsor address and his substrate mirror. If there is no confirmed sponsor error "Contract has no sponsor" throw.140	/// @dev EVM selector for this function is: 0x743fc745,141	///  or in textual repr: getSponsor(address)142	function getSponsor(address contractAddress)143=======144	// Selector: getSponsor(address) 743fc745145	function getSponsor(address contractAddress)146		public147		view148		returns (Tuple0 memory)149	{150		require(false, stub_error);151		contractAddress;152		dummy;153		return Tuple0(0x0000000000000000000000000000000000000000, 0);154	}155156	// Selector: hasSponsor(address) 97418603157	function hasSponsor(address contractAddress) public view returns (bool) {158		require(false, stub_error);159		contractAddress;160		dummy;161		return false;162	}163164	// Selector: hasPendingSponsor(address) 39b9b242165	function hasPendingSponsor(address contractAddress)166>>>>>>> path: add stubs167		public168		view169		returns (Tuple0 memory)170	{171		require(false, stub_error);172		contractAddress;173		dummy;174		return Tuple0(0x0000000000000000000000000000000000000000, 0);175	}176177	/// Check tat contract has confirmed sponsor.178	///179	/// @param contractAddress The contract for which the presence of a confirmed sponsor is checked.180	/// @return **true** if contract has confirmed sponsor.181	/// @dev EVM selector for this function is: 0x97418603,182	///  or in textual repr: hasSponsor(address)183	function hasSponsor(address contractAddress) public view returns (bool) {184		require(false, stub_error);185		contractAddress;186		dummy;187		return false;188	}189190<<<<<<< HEAD191	/// Check tat contract has pending sponsor.192	///193	/// @param contractAddress The contract for which the presence of a pending sponsor is checked.194	/// @return **true** if contract has pending sponsor.195	/// @dev EVM selector for this function is: 0x39b9b242,196	///  or in textual repr: hasPendingSponsor(address)197=======198<<<<<<< HEAD199	// Check tat contract has pending sponsor.200	//201	// @param contract_address The contract for which the presence of a pending sponsor is checked.202	// @return **true** if contract has pending sponsor.203	//204	// Selector: hasPendingSponsor(address) 39b9b242205>>>>>>> path: add stubs206	function hasPendingSponsor(address contractAddress)207=======208	// Selector: sponsoringEnabled(address) 6027dc61209	function sponsoringEnabled(address contractAddress)210>>>>>>> path: add stubs211		public212		view213		returns (bool)214	{215		require(false, stub_error);216		contractAddress;217		dummy;218		return false;219<<<<<<< HEAD220	}221222	/// @dev EVM selector for this function is: 0x6027dc61,223	///  or in textual repr: sponsoringEnabled(address)224	function sponsoringEnabled(address contractAddress)225		public226		view227		returns (bool)228	{229		require(false, stub_error);230		contractAddress;231		dummy;232		return false;233=======234>>>>>>> path: add stubs235	}236237	/// @dev EVM selector for this function is: 0xfde8a560,238	///  or in textual repr: setSponsoringMode(address,uint8)239	function setSponsoringMode(address contractAddress, uint8 mode) public {240		require(false, stub_error);241		contractAddress;242		mode;243		dummy = 0;244	}245246	/// Get current contract sponsoring rate limit247	/// @param contractAddress Contract to get sponsoring mode of248	/// @return uint32 Amount of blocks between two sponsored transactions249	/// @dev EVM selector for this function is: 0x610cfabd,250	///  or in textual repr: getSponsoringRateLimit(address)251	function getSponsoringRateLimit(address contractAddress)252		public253		view254		returns (uint32)255	{256		require(false, stub_error);257		contractAddress;258		dummy;259		return 0;260	}261262	/// Set contract sponsoring rate limit263	/// @dev Sponsoring rate limit - is a minimum amount of blocks that should264	///  pass between two sponsored transactions265	/// @param contractAddress Contract to change sponsoring rate limit of266	/// @param rateLimit Target rate limit267	/// @dev Only contract owner can change this setting268	/// @dev EVM selector for this function is: 0x77b6c908,269	///  or in textual repr: setSponsoringRateLimit(address,uint32)270	function setSponsoringRateLimit(address contractAddress, uint32 rateLimit)271		public272	{273		require(false, stub_error);274		contractAddress;275		rateLimit;276		dummy = 0;277	}278279	/// Is specified user present in contract allow list280	/// @dev Contract owner always implicitly included281	/// @param contractAddress Contract to check allowlist of282	/// @param user User to check283	/// @return bool Is specified users exists in contract allowlist284	/// @dev EVM selector for this function is: 0x5c658165,285	///  or in textual repr: allowed(address,address)286	function allowed(address contractAddress, address user)287		public288		view289		returns (bool)290	{291		require(false, stub_error);292		contractAddress;293		user;294		dummy;295		return false;296	}297298	/// Toggle user presence in contract allowlist299	/// @param contractAddress Contract to change allowlist of300	/// @param user Which user presence should be toggled301	/// @param isAllowed `true` if user should be allowed to be sponsored302	///  or call this contract, `false` otherwise303	/// @dev Only contract owner can change this setting304	/// @dev EVM selector for this function is: 0x4706cc1c,305	///  or in textual repr: toggleAllowed(address,address,bool)306	function toggleAllowed(307		address contractAddress,308		address user,309		bool isAllowed310	) public {311		require(false, stub_error);312		contractAddress;313		user;314		isAllowed;315		dummy = 0;316	}317318	/// Is this contract has allowlist access enabled319	/// @dev Allowlist always can have users, and it is used for two purposes:320	///  in case of allowlist sponsoring mode, users will be sponsored if they exist in allowlist321	///  in case of allowlist access enabled, only users from allowlist may call this contract322	/// @param contractAddress Contract to get allowlist access of323	/// @return bool Is specified contract has allowlist access enabled324	/// @dev EVM selector for this function is: 0xc772ef6c,325	///  or in textual repr: allowlistEnabled(address)326	function allowlistEnabled(address contractAddress)327		public328		view329		returns (bool)330	{331		require(false, stub_error);332		contractAddress;333		dummy;334		return false;335	}336337	/// Toggle contract allowlist access338	/// @param contractAddress Contract to change allowlist access of339	/// @param enabled Should allowlist access to be enabled?340	/// @dev EVM selector for this function is: 0x36de20f5,341	///  or in textual repr: toggleAllowlist(address,bool)342	function toggleAllowlist(address contractAddress, bool enabled) public {343		require(false, stub_error);344		contractAddress;345		enabled;346		dummy = 0;347	}348}349350/// @dev anonymous struct351struct Tuple0 {352	address field_0;353	uint256 field_1;354}
modifiedtests/src/eth/api/ContractHelpers.soldiffbeforeafterboth
--- a/tests/src/eth/api/ContractHelpers.sol
+++ b/tests/src/eth/api/ContractHelpers.sol
@@ -12,8 +12,16 @@
 	function supportsInterface(bytes4 interfaceID) external view returns (bool);
 }
 
+<<<<<<< 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
 interface ContractHelpers is Dummy, ERC165 {
 	/// Get user, which deployed specified contract
 	/// @dev May return zero address in case if contract is deployed
@@ -29,11 +37,21 @@
 		view
 		returns (address);
 
+<<<<<<< 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.
+	//
+	// Selector: setSponsor(address,address) f01fba93
+>>>>>>> path: add stubs
 	function setSponsor(address contractAddress, address sponsor) external;
 
 	/// Set contract as self sponsored.
@@ -59,17 +77,35 @@
 	///  or in textual repr: confirmSponsorship(address)
 	function confirmSponsorship(address contractAddress) external;
 
+<<<<<<< HEAD
 	/// Get current sponsor.
 	///
 	/// @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.
 	/// @dev EVM selector for this function is: 0x743fc745,
 	///  or in textual repr: getSponsor(address)
+=======
+	// Get current sponsor.
+	//
+	// @param contract_address 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.
+	//
+=======
+	// Selector: setSponsor(address,address) f01fba93
+	function setSponsor(address contractAddress, address sponsor) external;
+
+	// Selector: confirmSponsorship(address) abc00001
+	function confirmSponsorship(address contractAddress) external;
+
+>>>>>>> path: add stubs
+	// Selector: getSponsor(address) 743fc745
+>>>>>>> path: add stubs
 	function getSponsor(address contractAddress)
 		external
 		view
 		returns (Tuple0 memory);
 
+<<<<<<< HEAD
 	/// Check tat contract has confirmed sponsor.
 	///
 	/// @param contractAddress The contract for which the presence of a confirmed sponsor is checked.
@@ -84,6 +120,28 @@
 	/// @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 confirmed sponsor.
+	//
+	// @param contract_address The contract for which the presence of a confirmed sponsor is checked.
+	// @return **true** if contract has confirmed sponsor.
+	//
+	// Selector: hasSponsor(address) 97418603
+	function hasSponsor(address contractAddress) external view returns (bool);
+
+	// 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: hasSponsor(address) 97418603
+	function hasSponsor(address contractAddress) external view returns (bool);
+
+>>>>>>> path: add stubs
+	// Selector: hasPendingSponsor(address) 39b9b242
+>>>>>>> path: add stubs
 	function hasPendingSponsor(address contractAddress)
 		external
 		view
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" }
     ],