diff --git a/genlayer_py/contracts/actions.py b/genlayer_py/contracts/actions.py index 08e69b1..00ca14a 100644 --- a/genlayer_py/contracts/actions.py +++ b/genlayer_py/contracts/actions.py @@ -42,9 +42,14 @@ def get_contract_schema_for_code( if self.chain.id != localnet.id: raise GenLayerError("Contract schema is not supported on this network") + try: + encoded_contract_code = eth_utils.hexadecimal.encode_hex(contract_code) + except: + encoded_contract_code = contract_code + response = self.provider.make_request( method="gen_getContractSchemaForCode", - params=[eth_utils.hexadecimal.encode_hex(contract_code)], + params=[encoded_contract_code], ) return response["result"]