|
|
@ -69,7 +69,8 @@ defmodule Explorer.SmartContract.Verifier do |
|
|
|
blockchain_bytecode_without_whisper = extract_bytecode(blockchain_bytecode) |
|
|
|
blockchain_bytecode_without_whisper = extract_bytecode(blockchain_bytecode) |
|
|
|
|
|
|
|
|
|
|
|
cond do |
|
|
|
cond do |
|
|
|
generated_bytecode != blockchain_bytecode_without_whisper -> |
|
|
|
generated_bytecode != blockchain_bytecode_without_whisper && |
|
|
|
|
|
|
|
!try_library_verification(generated_bytecode, blockchain_bytecode_without_whisper) -> |
|
|
|
{:error, :generated_bytecode} |
|
|
|
{:error, :generated_bytecode} |
|
|
|
|
|
|
|
|
|
|
|
has_constructor_with_params?(abi) && |
|
|
|
has_constructor_with_params?(abi) && |
|
|
@ -81,6 +82,17 @@ defmodule Explorer.SmartContract.Verifier do |
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
defp try_library_verification( |
|
|
|
|
|
|
|
"730000000000000000000000000000000000000000" <> bytecode, |
|
|
|
|
|
|
|
<<_address::binary-size(42)>> <> bytecode |
|
|
|
|
|
|
|
) do |
|
|
|
|
|
|
|
true |
|
|
|
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
defp try_library_verification(_, _) do |
|
|
|
|
|
|
|
false |
|
|
|
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
@doc """ |
|
|
|
@doc """ |
|
|
|
In order to discover the bytecode we need to remove the `swarm source` from |
|
|
|
In order to discover the bytecode we need to remove the `swarm source` from |
|
|
|
the hash. |
|
|
|
the hash. |
|
|
|