@@ -172,43 +172,6 @@ def add_bytes32_array(self, value: List[bytes]) -> "ContractFunctionParameters":
172
172
"""
173
173
return self ._add_param ("bytes32[]" , value )
174
174
175
- def add_function (
176
- self , address : str , function_signature : str
177
- ) -> "ContractFunctionParameters" :
178
- """
179
- Add a function parameter.
180
-
181
- Args:
182
- address: The contract address as a hex string (with or without 0x prefix)
183
- function_signature: The function signature (e.g., "transfer(address,uint256)")
184
-
185
- Returns:
186
- This instance for method chaining
187
-
188
- Raises:
189
- ValueError: If address is not valid or function_signature is invalid
190
- """
191
- # Process address
192
- if address .startswith ("0x" ):
193
- address = address [2 :]
194
-
195
- # Validate and convert address
196
- if len (address ) != 40 :
197
- raise ValueError ("address is required to be 40 characters" )
198
-
199
- try :
200
- address_bytes = bytes .fromhex (address )
201
- except Exception as e :
202
- raise e
203
-
204
- # Generate function selector (4 bytes) from signature using eth_utils
205
- selector_bytes = function_signature_to_4byte_selector (function_signature )
206
-
207
- # In Ethereum ABI, a function type is encoded as (address, bytes4)
208
- # So we pass a tuple with address bytes and selector bytes to match the ABI encoding
209
- # eth-abi will handle the proper encoding internally
210
- return self ._add_param ("(address,bytes4)" , (address_bytes , selector_bytes ))
211
-
212
175
def _get_function_selector (self ) -> bytes :
213
176
"""
214
177
Get the function selector (first 4 bytes of the keccak256 hash of the function signature).
0 commit comments