Skip to content

Commit

Permalink
Check type of result before parsing it as string #268 (#286)
Browse files Browse the repository at this point in the history
Co-authored-by: Semen Medvedev <[email protected]>
  • Loading branch information
s-medvedev and Semen Medvedev authored Nov 12, 2021
1 parent 51c3119 commit 5b8a479
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion proxy/plugin/solana_rest_api_tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 5b8a479

Please sign in to comment.