diff --git a/CHANGELOG.md b/CHANGELOG.md index 9b03eaf4c861..183d82e4f5d5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,7 @@ ### Fixes - [#8714](https://github.com/blockscout/blockscout/pull/8714) - Fix sourcify check +- [#8706](https://github.com/blockscout/blockscout/pull/8706) - Add address name updating on contract re-verification - [#8705](https://github.com/blockscout/blockscout/pull/8705) - Fix sourcify enabled flag - [#8695](https://github.com/blockscout/blockscout/pull/8695) - Don't override internal transaction error if it's present already - [#8685](https://github.com/blockscout/blockscout/pull/8685) - Fix db pool size exceeds Postgres max connections diff --git a/apps/explorer/lib/explorer/chain.ex b/apps/explorer/lib/explorer/chain.ex index 09a01377cd05..bc0dde821ba8 100644 --- a/apps/explorer/lib/explorer/chain.ex +++ b/apps/explorer/lib/explorer/chain.ex @@ -3683,6 +3683,7 @@ defmodule Explorer.Chain do # Enforce ShareLocks tables order (see docs: sharelocks.md) insert_contract_query = Multi.new() + |> Multi.run(:clear_primary_address_names, fn repo, _ -> clear_primary_address_names(repo, address_hash) end) |> Multi.update(:smart_contract, smart_contract_changeset) insert_contract_query_with_additional_sources = @@ -3696,6 +3697,8 @@ defmodule Explorer.Chain do insert_contract_query_with_additional_sources |> Repo.transaction() + create_address_name(Repo, Changeset.get_field(smart_contract_changeset, :name), address_hash) + case insert_result do {:ok, %{smart_contract: smart_contract}} -> {:ok, smart_contract}