diff --git a/.dialyzer-ignore b/.dialyzer-ignore index ccb1c2e71b..1324d90572 100644 --- a/.dialyzer-ignore +++ b/.dialyzer-ignore @@ -23,6 +23,6 @@ lib/indexer/fetcher/token_total_supply_on_demand.ex:16 lib/explorer/exchange_rates/source.ex:104 lib/explorer/exchange_rates/source.ex:107 lib/explorer/smart_contract/verifier.ex:89 -lib/block_scout_web/templates/address_contract/index.html.eex:117 +lib/block_scout_web/templates/address_contract/index.html.eex:118 lib/explorer/staking/stake_snapshotting.ex:14: Function do_snapshotting/6 has no local return lib/explorer/staking/stake_snapshotting.ex:183 diff --git a/CHANGELOG.md b/CHANGELOG.md index f46f9aae3c..9f5de8eb50 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,10 +1,12 @@ ## Current ### Features +- [#3540](https://github.com/poanetwork/blockscout/pull/3540) - Apply DarkForest custom theme to NFT instances ### Fixes ### Chore +- [#3540](https://github.com/poanetwork/blockscout/pull/3540) - Support different versions of DarkForest (0.4 - 0.5) ## 3.5.0-beta diff --git a/apps/block_scout_web/assets/css/theme/custom_contracts/_dark-forest-theme.scss b/apps/block_scout_web/assets/css/theme/custom_contracts/_dark-forest-theme.scss index df7909057f..3294353c51 100644 --- a/apps/block_scout_web/assets/css/theme/custom_contracts/_dark-forest-theme.scss +++ b/apps/block_scout_web/assets/css/theme/custom_contracts/_dark-forest-theme.scss @@ -269,7 +269,7 @@ $dark-primary-alternate: $dark-primary; content: url(/images/custom-themes/dark-forest/qr.svg); } - .btn-copy-icon, .btn-qr-icon, .btn-address-card-icon .btn-contract-icon { + .btn-copy-icon, .btn-qr-icon, .btn-address-card-icon { border-radius: 0; border: none; border-color: $dark-primary; @@ -277,6 +277,19 @@ $dark-primary-alternate: $dark-primary; background-color: rgba(117, 249, 77, 0.4); } } + + .btn-contract-icon { + border-radius: 0; + border-color: $dark-primary; + &:hover { + background-color: rgba(117, 249, 77, 0.4); + } + svg { + path { + fill: $dark-primary; + } + } + } // pagination .pagination-container .pagination .page-link { diff --git a/apps/block_scout_web/config/config.exs b/apps/block_scout_web/config/config.exs index de69c50848..6ab54f6e8b 100644 --- a/apps/block_scout_web/config/config.exs +++ b/apps/block_scout_web/config/config.exs @@ -42,6 +42,7 @@ config :block_scout_web, restricted_list: System.get_env("RESTRICTED_LIST", nil), restricted_list_key: System.get_env("RESTRICTED_LIST_KEY", nil), dark_forest_addresses: System.get_env("CUSTOM_CONTRACT_ADDRESSES_DARK_FOREST"), + dark_forest_addresses_v_0_5: System.get_env("CUSTOM_CONTRACT_ADDRESSES_DARK_FOREST_V_0_5"), circles_addresses: System.get_env("CUSTOM_CONTRACT_ADDRESSES_CIRCLES") config :block_scout_web, BlockScoutWeb.Counters.BlocksIndexedCounter, enabled: true diff --git a/apps/block_scout_web/lib/block_scout_web/controller.ex b/apps/block_scout_web/lib/block_scout_web/controller.ex index 38f28be0c6..5cff2fa955 100644 --- a/apps/block_scout_web/lib/block_scout_web/controller.ex +++ b/apps/block_scout_web/lib/block_scout_web/controller.ex @@ -13,7 +13,7 @@ defmodule BlockScoutWeb.Controller do conn |> put_status(:not_found) |> put_view(BlockScoutWeb.PageNotFoundView) - |> render(:index) + |> render(:index, token: nil) |> halt() end diff --git a/apps/block_scout_web/lib/block_scout_web/controllers/api/v1/decompiled_smart_contract_controller.ex b/apps/block_scout_web/lib/block_scout_web/controllers/api/v1/decompiled_smart_contract_controller.ex index 7b783b9761..6b03afe82a 100644 --- a/apps/block_scout_web/lib/block_scout_web/controllers/api/v1/decompiled_smart_contract_controller.ex +++ b/apps/block_scout_web/lib/block_scout_web/controllers/api/v1/decompiled_smart_contract_controller.ex @@ -12,7 +12,7 @@ defmodule BlockScoutWeb.API.V1.DecompiledSmartContractController do {:contract, Chain.check_decompiled_contract_exists(params["address_hash"], params["decompiler_version"])} do case Chain.create_decompiled_smart_contract(params) do {:ok, decompiled_smart_contract} -> - send_resp(conn, :created, Jason.encode!(decompiled_smart_contract)) + send_resp(conn, :created, encode(decompiled_smart_contract)) {:error, changeset} -> errors = diff --git a/apps/block_scout_web/lib/block_scout_web/controllers/api/v1/verified_smart_contract_controller.ex b/apps/block_scout_web/lib/block_scout_web/controllers/api/v1/verified_smart_contract_controller.ex index 8b3d3d71eb..af74c0c4df 100644 --- a/apps/block_scout_web/lib/block_scout_web/controllers/api/v1/verified_smart_contract_controller.ex +++ b/apps/block_scout_web/lib/block_scout_web/controllers/api/v1/verified_smart_contract_controller.ex @@ -13,7 +13,7 @@ defmodule BlockScoutWeb.API.V1.VerifiedSmartContractController do case Publisher.publish(hash, params, external_libraries) do {:ok, _} -> - send_resp(conn, :created, Jason.encode!(%{status: :success})) + send_resp(conn, :created, encode(%{status: :success})) {:error, changeset} -> errors = diff --git a/apps/block_scout_web/lib/block_scout_web/controllers/page_not_found_controller.ex b/apps/block_scout_web/lib/block_scout_web/controllers/page_not_found_controller.ex index 7ea8fab254..fabcb3b733 100644 --- a/apps/block_scout_web/lib/block_scout_web/controllers/page_not_found_controller.ex +++ b/apps/block_scout_web/lib/block_scout_web/controllers/page_not_found_controller.ex @@ -4,6 +4,6 @@ defmodule BlockScoutWeb.PageNotFoundController do def index(conn, _params) do conn |> put_status(:not_found) - |> render("index.html") + |> render("index.html", token: nil) end end diff --git a/apps/block_scout_web/lib/block_scout_web/templates/address/_custom_view_df_title.html.eex b/apps/block_scout_web/lib/block_scout_web/templates/address/_custom_view_df_title.html.eex new file mode 100644 index 0000000000..fd99f0af95 --- /dev/null +++ b/apps/block_scout_web/lib/block_scout_web/templates/address/_custom_view_df_title.html.eex @@ -0,0 +1,19 @@ +
<%= transaction_init %>