From 5b8a479c0d6f360594f16ec91bad435a137ac024 Mon Sep 17 00:00:00 2001 From: s-medvedev <40623263+s-medvedev@users.noreply.github.com> Date: Fri, 12 Nov 2021 18:54:42 +0700 Subject: [PATCH] Check type of result before parsing it as string #268 (#286) Co-authored-by: Semen Medvedev --- proxy/plugin/solana_rest_api_tools.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/proxy/plugin/solana_rest_api_tools.py b/proxy/plugin/solana_rest_api_tools.py index 80d225ee6..7cdc3b06c 100644 --- a/proxy/plugin/solana_rest_api_tools.py +++ b/proxy/plugin/solana_rest_api_tools.py @@ -313,7 +313,7 @@ def call_emulated(contract_id, caller_id, data=None, value=None): exit_status = result['exit_status'] if exit_status == 'revert': result_value = result['result'] - if len(result_value) == 0: + if len(result_value) < 8 or result_value[:8] != '08c379a0': raise EthereumError(code=3, message='execution reverted') offset = int(result_value[8:8+64], 16)