Improve verification

pull/3370/head
Victor Baranov 4 years ago
parent f2d503ba4c
commit aab3d13faf
  1. 1
      CHANGELOG.md
  2. 14
      apps/explorer/lib/explorer/smart_contract/verifier/constructor_arguments.ex

@ -8,6 +8,7 @@
### Fixes ### Fixes
- [#3370](https://github.com/poanetwork/blockscout/pull/3370) - Improve contracts verification: refine constructor arguments extractor
- [#3368](https://github.com/poanetwork/blockscout/pull/3368) - Fix Verify contract loading button width - [#3368](https://github.com/poanetwork/blockscout/pull/3368) - Fix Verify contract loading button width
- [#3357](https://github.com/poanetwork/blockscout/pull/3357) - Fix token transfer realtime fetcher - [#3357](https://github.com/poanetwork/blockscout/pull/3357) - Fix token transfer realtime fetcher
- [#3353](https://github.com/poanetwork/blockscout/pull/3353) - Fix xDai buttons hover color - [#3353](https://github.com/poanetwork/blockscout/pull/3353) - Fix xDai buttons hover color

@ -244,8 +244,18 @@ defmodule Explorer.SmartContract.Verifier.ConstructorArguments do
metadata_hash_prefix metadata_hash_prefix
) do ) do
if is_constructor_arguments_still_has_metadata_prefix(constructor_arguments, metadata_hash_prefix) do if is_constructor_arguments_still_has_metadata_prefix(constructor_arguments, metadata_hash_prefix) do
<<_::binary-size(2)>> <> rest = constructor_arguments {ind, _} = :binary.match(constructor_arguments, metadata_hash_prefix)
extract_constructor_arguments(rest, check_func, contract_source_code, contract_name) offset = if ind > 2, do: ind - 2, else: 0
processed_constructor_arguments =
if offset > 0 do
<<_::binary-size(offset)>> <> rest = constructor_arguments
rest
else
constructor_arguments
end
extract_constructor_arguments(processed_constructor_arguments, check_func, contract_source_code, contract_name)
else else
extract_constructor_arguments_check_func( extract_constructor_arguments_check_func(
constructor_arguments, constructor_arguments,

Loading…
Cancel
Save