diff --git a/CHANGELOG.md b/CHANGELOG.md
index b50a716de3..5a8d2a43aa 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,6 +1,7 @@
## Current
### Features
+- [#2825](https://github.com/poanetwork/blockscout/pull/2825) - separate token transfers and transactions
- [#2787](https://github.com/poanetwork/blockscout/pull/2787) - async fetching of address counters
- [#2791](https://github.com/poanetwork/blockscout/pull/2791) - add ipc client
- [#2449](https://github.com/poanetwork/blockscout/pull/2449) - add ability to send notification events through postgres notify
@@ -8,6 +9,7 @@
### Fixes
- [#2854](https://github.com/poanetwork/blockscout/pull/2854) - Fix all npm vulnerabilities
+- [#2851](https://github.com/poanetwork/blockscout/pull/2851) - Fix paths for front assets
- [#2843](https://github.com/poanetwork/blockscout/pull/2843) - fix realtime fetcher small skips feature
- [#2841](https://github.com/poanetwork/blockscout/pull/2841) - LUKSO dashboard height fix
- [#2837](https://github.com/poanetwork/blockscout/pull/2837) - fix txlist ordering issue
@@ -101,6 +103,7 @@ fixed menu hovers in dark mode desktop view
- [#2724](https://github.com/poanetwork/blockscout/pull/2724) - fix ci by commenting a line in hackney library
- [#2708](https://github.com/poanetwork/blockscout/pull/2708) - add log index to logs view
- [#2723](https://github.com/poanetwork/blockscout/pull/2723) - get rid of ex_json_schema warnings
+- [#2740](https://github.com/poanetwork/blockscout/pull/2740) - add verify contract rpc doc
## 2.0.4-beta
diff --git a/apps/block_scout_web/lib/block_scout_web/controllers/address_token_transfer_controller.ex b/apps/block_scout_web/lib/block_scout_web/controllers/address_token_transfer_controller.ex
index 6c0899624a..af7a4c93f4 100644
--- a/apps/block_scout_web/lib/block_scout_web/controllers/address_token_transfer_controller.ex
+++ b/apps/block_scout_web/lib/block_scout_web/controllers/address_token_transfer_controller.ex
@@ -8,7 +8,20 @@ defmodule BlockScoutWeb.AddressTokenTransferController do
alias Phoenix.View
import BlockScoutWeb.Chain,
- only: [next_page_params: 3, paging_options: 1, split_list_by_page: 1]
+ only: [current_filter: 1, next_page_params: 3, paging_options: 1, split_list_by_page: 1]
+
+ @transaction_necessity_by_association [
+ necessity_by_association: %{
+ [created_contract_address: :names] => :optional,
+ [from_address: :names] => :optional,
+ [to_address: :names] => :optional,
+ [token_transfers: :token] => :optional,
+ [token_transfers: :to_address] => :optional,
+ [token_transfers: :from_address] => :optional,
+ [token_transfers: :token_contract_address] => :optional,
+ :block => :required
+ }
+ ]
def index(
conn,
@@ -93,4 +106,86 @@ defmodule BlockScoutWeb.AddressTokenTransferController do
not_found(conn)
end
end
+
+ def index(
+ conn,
+ %{
+ "address_id" => address_hash_string,
+ "type" => "JSON"
+ } = params
+ ) do
+ with {:ok, address_hash} <- Chain.string_to_address_hash(address_hash_string),
+ {:ok, address} <- Chain.hash_to_address(address_hash) do
+ options =
+ @transaction_necessity_by_association
+ |> Keyword.merge(paging_options(params))
+ |> Keyword.merge(current_filter(params))
+
+ transactions =
+ Chain.address_hash_to_token_transfers(
+ address_hash,
+ options
+ )
+
+ {transactions_paginated, next_page} = split_list_by_page(transactions)
+
+ next_page_path =
+ case next_page_params(next_page, transactions_paginated, params) do
+ nil ->
+ nil
+
+ next_page_params ->
+ address_token_transfers_path(
+ conn,
+ :index,
+ address_hash_string,
+ Map.delete(next_page_params, "type")
+ )
+ end
+
+ transfers_json =
+ Enum.map(transactions_paginated, fn transaction ->
+ View.render_to_string(
+ TransactionView,
+ "_tile.html",
+ conn: conn,
+ transaction: transaction,
+ current_address: address
+ )
+ end)
+
+ json(conn, %{items: transfers_json, next_page_path: next_page_path})
+ else
+ :error ->
+ unprocessable_entity(conn)
+
+ {:error, :not_found} ->
+ not_found(conn)
+ end
+ end
+
+ def index(
+ conn,
+ %{"address_id" => address_hash_string} = params
+ ) do
+ with {:ok, address_hash} <- Chain.string_to_address_hash(address_hash_string),
+ {:ok, address} <- Chain.hash_to_address(address_hash) do
+ render(
+ conn,
+ "index.html",
+ address: address,
+ coin_balance_status: CoinBalanceOnDemand.trigger_fetch(address),
+ exchange_rate: Market.get_exchange_rate(Explorer.coin()) || Token.null(),
+ filter: params["filter"],
+ current_path: current_path(conn),
+ counters_path: address_path(conn, :address_counters, %{"id" => to_string(address_hash)})
+ )
+ else
+ :error ->
+ unprocessable_entity(conn)
+
+ {:error, :not_found} ->
+ not_found(conn)
+ end
+ end
end
diff --git a/apps/block_scout_web/lib/block_scout_web/controllers/address_transaction_controller.ex b/apps/block_scout_web/lib/block_scout_web/controllers/address_transaction_controller.ex
index b79800a464..2bac5acdb2 100644
--- a/apps/block_scout_web/lib/block_scout_web/controllers/address_transaction_controller.ex
+++ b/apps/block_scout_web/lib/block_scout_web/controllers/address_transaction_controller.ex
@@ -19,10 +19,6 @@ defmodule BlockScoutWeb.AddressTransactionController do
[created_contract_address: :names] => :optional,
[from_address: :names] => :optional,
[to_address: :names] => :optional,
- [token_transfers: :token] => :optional,
- [token_transfers: :to_address] => :optional,
- [token_transfers: :from_address] => :optional,
- [token_transfers: :token_contract_address] => :optional,
:block => :required
}
]
diff --git a/apps/block_scout_web/lib/block_scout_web/etherscan.ex b/apps/block_scout_web/lib/block_scout_web/etherscan.ex
index cedc6d77ad..eadaf0fff5 100644
--- a/apps/block_scout_web/lib/block_scout_web/etherscan.ex
+++ b/apps/block_scout_web/lib/block_scout_web/etherscan.ex
@@ -1946,7 +1946,24 @@ defmodule BlockScoutWeb.Etherscan do
@contract_verify_action %{
name: "verify",
- description: "Verify a contract with its source code and contract creation information.",
+ description: """
+ Verify a contract with its source code and contract creation information.
+
+
+
curl POST example:
+