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

difftreelog

chore update evm stubs

Grigoriy Simonov2022-09-13parent: #781ae2a.patch.diff
in: master

3 files changed

modifiedpallets/evm-contract-helpers/src/stubs/ContractHelpers.rawdiffbeforeafterboth

binary blob — no preview

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/// @dev inlined interface25contract ContractHelpersEvents {26	event ContractSponsorSet(address indexed contractAddress, address sponsor);27	event ContractSponsorshipConfirmed(28		address indexed contractAddress,29		address sponsor30	);31	event ContractSponsorRemoved(address indexed contractAddress);32}3334/// @title Magic contract, which allows users to reconfigure other contracts35/// @dev the ERC-165 identifier for this interface is 0x172cb4fb36contract ContractHelpers is Dummy, ERC165, ContractHelpersEvents {37	/// Get user, which deployed specified contract38	/// @dev May return zero address in case if contract is deployed39	///  using uniquenetwork evm-migration pallet, or using other terms not40	///  intended by pallet-evm41	/// @dev Returns zero address if contract does not exists42	/// @param contractAddress Contract to get owner of43	/// @return address Owner of contract44	/// @dev EVM selector for this function is: 0x5152b14c,45	///  or in textual repr: contractOwner(address)46	function contractOwner(address contractAddress)47		public48		view49		returns (address)50	{51		require(false, stub_error);52		contractAddress;53		dummy;54		return 0x0000000000000000000000000000000000000000;55	}5657	/// Set sponsor.58	/// @param contractAddress Contract for which a sponsor is being established.59	/// @param sponsor User address who set as pending sponsor.60	/// @dev EVM selector for this function is: 0xf01fba93,61	///  or in textual repr: setSponsor(address,address)62	function setSponsor(address contractAddress, address sponsor) public {63		require(false, stub_error);64		contractAddress;65		sponsor;66		dummy = 0;67	}6869	/// Set contract as self sponsored.70	///71	/// @param contractAddress Contract for which a self sponsoring is being enabled.72	/// @dev EVM selector for this function is: 0x89f7d9ae,73	///  or in textual repr: selfSponsoredEnable(address)74	function selfSponsoredEnable(address contractAddress) public {75		require(false, stub_error);76		contractAddress;77		dummy = 0;78	}7980	/// Remove sponsor.81	///82	/// @param contractAddress Contract for which a sponsorship is being removed.83	/// @dev EVM selector for this function is: 0xef784250,84	///  or in textual repr: removeSponsor(address)85	function removeSponsor(address contractAddress) public {86		require(false, stub_error);87		contractAddress;88		dummy = 0;89	}9091	/// Confirm sponsorship.92	///93	/// @dev Caller must be same that set via [`setSponsor`].94	///95	/// @param contractAddress Сontract for which need to confirm sponsorship.96	/// @dev EVM selector for this function is: 0xabc00001,97	///  or in textual repr: confirmSponsorship(address)98	function confirmSponsorship(address contractAddress) public {99		require(false, stub_error);100		contractAddress;101		dummy = 0;102	}103104	/// Get current sponsor.105	///106	/// @param contractAddress The contract for which a sponsor is requested.107	/// @return Tuble with sponsor address and his substrate mirror. If there is no confirmed sponsor error "Contract has no sponsor" throw.108	/// @dev EVM selector for this function is: 0x743fc745,109	///  or in textual repr: getSponsor(address)110	function getSponsor(address contractAddress)111		public112		view113		returns (Tuple0 memory)114	{115		require(false, stub_error);116		contractAddress;117		dummy;118		return Tuple0(0x0000000000000000000000000000000000000000, 0);119	}120121	/// Check tat contract has confirmed sponsor.122	///123	/// @param contractAddress The contract for which the presence of a confirmed sponsor is checked.124	/// @return **true** if contract has confirmed sponsor.125	/// @dev EVM selector for this function is: 0x97418603,126	///  or in textual repr: hasSponsor(address)127	function hasSponsor(address contractAddress) public view returns (bool) {128		require(false, stub_error);129		contractAddress;130		dummy;131		return false;132	}133134	/// Check tat contract has pending sponsor.135	///136	/// @param contractAddress The contract for which the presence of a pending sponsor is checked.137	/// @return **true** if contract has pending sponsor.138	/// @dev EVM selector for this function is: 0x39b9b242,139	///  or in textual repr: hasPendingSponsor(address)140	function hasPendingSponsor(address contractAddress)141		public142		view143		returns (bool)144	{145		require(false, stub_error);146		contractAddress;147		dummy;148		return false;149	}150151	/// @dev EVM selector for this function is: 0x6027dc61,152	///  or in textual repr: sponsoringEnabled(address)153	function sponsoringEnabled(address contractAddress)154		public155		view156		returns (bool)157	{158		require(false, stub_error);159		contractAddress;160		dummy;161		return false;162	}163164	/// @dev EVM selector for this function is: 0xfde8a560,165	///  or in textual repr: setSponsoringMode(address,uint8)166	function setSponsoringMode(address contractAddress, uint8 mode) public {167		require(false, stub_error);168		contractAddress;169		mode;170		dummy = 0;171	}172173	/// Get current contract sponsoring rate limit174	/// @param contractAddress Contract to get sponsoring mode of175	/// @return uint32 Amount of blocks between two sponsored transactions176	/// @dev EVM selector for this function is: 0x610cfabd,177	///  or in textual repr: getSponsoringRateLimit(address)178	function getSponsoringRateLimit(address contractAddress)179		public180		view181		returns (uint32)182	{183		require(false, stub_error);184		contractAddress;185		dummy;186		return 0;187	}188189	/// Set contract sponsoring rate limit190	/// @dev Sponsoring rate limit - is a minimum amount of blocks that should191	///  pass between two sponsored transactions192	/// @param contractAddress Contract to change sponsoring rate limit of193	/// @param rateLimit Target rate limit194	/// @dev Only contract owner can change this setting195	/// @dev EVM selector for this function is: 0x77b6c908,196	///  or in textual repr: setSponsoringRateLimit(address,uint32)197	function setSponsoringRateLimit(address contractAddress, uint32 rateLimit)198		public199	{200		require(false, stub_error);201		contractAddress;202		rateLimit;203		dummy = 0;204	}205206	/// @dev EVM selector for this function is: 0x03aed665,207	///  or in textual repr: setSponsoringFeeLimit(address,uint256)208	function setSponsoringFeeLimit(address contractAddress, uint256 feeLimit)209		public210	{211		require(false, stub_error);212		contractAddress;213		feeLimit;214		dummy = 0;215	}216217	/// @dev EVM selector for this function is: 0xc3fdc9ee,218	///  or in textual repr: getSponsoringFeeLimit(address)219	function getSponsoringFeeLimit(address contractAddress)220		public221		view222		returns (uint256)223	{224		require(false, stub_error);225		contractAddress;226		dummy;227		return 0;228	}229230	/// Is specified user present in contract allow list231	/// @dev Contract owner always implicitly included232	/// @param contractAddress Contract to check allowlist of233	/// @param user User to check234	/// @return bool Is specified users exists in contract allowlist235	/// @dev EVM selector for this function is: 0x5c658165,236	///  or in textual repr: allowed(address,address)237	function allowed(address contractAddress, address user)238		public239		view240		returns (bool)241	{242		require(false, stub_error);243		contractAddress;244		user;245		dummy;246		return false;247	}248249	/// Toggle user presence in contract allowlist250	/// @param contractAddress Contract to change allowlist of251	/// @param user Which user presence should be toggled252	/// @param isAllowed `true` if user should be allowed to be sponsored253	///  or call this contract, `false` otherwise254	/// @dev Only contract owner can change this setting255	/// @dev EVM selector for this function is: 0x4706cc1c,256	///  or in textual repr: toggleAllowed(address,address,bool)257	function toggleAllowed(258		address contractAddress,259		address user,260		bool isAllowed261	) public {262		require(false, stub_error);263		contractAddress;264		user;265		isAllowed;266		dummy = 0;267	}268269	/// Is this contract has allowlist access enabled270	/// @dev Allowlist always can have users, and it is used for two purposes:271	///  in case of allowlist sponsoring mode, users will be sponsored if they exist in allowlist272	///  in case of allowlist access enabled, only users from allowlist may call this contract273	/// @param contractAddress Contract to get allowlist access of274	/// @return bool Is specified contract has allowlist access enabled275	/// @dev EVM selector for this function is: 0xc772ef6c,276	///  or in textual repr: allowlistEnabled(address)277	function allowlistEnabled(address contractAddress)278		public279		view280		returns (bool)281	{282		require(false, stub_error);283		contractAddress;284		dummy;285		return false;286	}287288	/// Toggle contract allowlist access289	/// @param contractAddress Contract to change allowlist access of290	/// @param enabled Should allowlist access to be enabled?291	/// @dev EVM selector for this function is: 0x36de20f5,292	///  or in textual repr: toggleAllowlist(address,bool)293	function toggleAllowlist(address contractAddress, bool enabled) public {294		require(false, stub_error);295		contractAddress;296		enabled;297		dummy = 0;298	}299}300301/// @dev anonymous struct302struct Tuple0 {303	address field_0;304	uint256 field_1;305}
modifiedtests/src/eth/api/ContractHelpers.soldiffbeforeafterboth
--- a/tests/src/eth/api/ContractHelpers.sol
+++ b/tests/src/eth/api/ContractHelpers.sol
@@ -111,7 +111,7 @@
 	function setSponsoringMode(address contractAddress, uint8 mode) external;
 
 	/// Get current contract sponsoring rate limit
-	/// @param contractAddress Contract to get sponsoring mode of
+	/// @param contractAddress Contract to get sponsoring rate limit of
 	/// @return uint32 Amount of blocks between two sponsored transactions
 	/// @dev EVM selector for this function is: 0x610cfabd,
 	///  or in textual repr: getSponsoringRateLimit(address)
@@ -131,11 +131,21 @@
 	function setSponsoringRateLimit(address contractAddress, uint32 rateLimit)
 		external;
 
+	/// Set contract sponsoring fee limit
+	/// @dev Sponsoring fee limit - is maximum fee that could be spent by
+	///  single transaction
+	/// @param contractAddress Contract to change sponsoring fee limit of
+	/// @param feeLimit Fee limit
+	/// @dev Only contract owner can change this setting
 	/// @dev EVM selector for this function is: 0x03aed665,
 	///  or in textual repr: setSponsoringFeeLimit(address,uint256)
 	function setSponsoringFeeLimit(address contractAddress, uint256 feeLimit)
 		external;
 
+	/// Get current contract sponsoring fee limit
+	/// @param contractAddress Contract to get sponsoring fee limit of
+	/// @return uint256 Maximum amount of fee that could be spent by single
+	///  transaction
 	/// @dev EVM selector for this function is: 0xc3fdc9ee,
 	///  or in textual repr: getSponsoringFeeLimit(address)
 	function getSponsoringFeeLimit(address contractAddress)