|
|
@ -6,6 +6,8 @@ defmodule BlockScoutWeb.Tokens.OverviewView do |
|
|
|
alias BlockScoutWeb.{CurrencyHelpers, LayoutView} |
|
|
|
alias BlockScoutWeb.{CurrencyHelpers, LayoutView} |
|
|
|
|
|
|
|
|
|
|
|
@tabs ["token_transfers", "token_holders", "read_contract", "inventory"] |
|
|
|
@tabs ["token_transfers", "token_holders", "read_contract", "inventory"] |
|
|
|
|
|
|
|
@etherscan_token_link "https://etherscan.io/token/" |
|
|
|
|
|
|
|
@blockscout_base_link "https://blockscout.com/" |
|
|
|
|
|
|
|
|
|
|
|
def decimals?(%Token{decimals: nil}), do: false |
|
|
|
def decimals?(%Token{decimals: nil}), do: false |
|
|
|
def decimals?(%Token{decimals: _}), do: true |
|
|
|
def decimals?(%Token{decimals: _}), do: true |
|
|
@ -71,16 +73,20 @@ defmodule BlockScoutWeb.Tokens.OverviewView do |
|
|
|
base_token_explorer_link <> foreign_token_contract_address_hash_string |
|
|
|
base_token_explorer_link <> foreign_token_contract_address_hash_string |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# credo:disable-for-next-line /Complexity/ |
|
|
|
defp get_base_token_explorer_link(chain_id) when not is_nil(chain_id) do |
|
|
|
defp get_base_token_explorer_link(chain_id) when not is_nil(chain_id) do |
|
|
|
case Decimal.to_integer(chain_id) do |
|
|
|
case Decimal.to_integer(chain_id) do |
|
|
|
|
|
|
|
181 -> |
|
|
|
|
|
|
|
@blockscout_base_link <> "poa/qdai/tokens/" |
|
|
|
|
|
|
|
|
|
|
|
100 -> |
|
|
|
100 -> |
|
|
|
"https://blockscout.com/poa/xdai/tokens/" |
|
|
|
@blockscout_base_link <> "poa/xdai/tokens/" |
|
|
|
|
|
|
|
|
|
|
|
99 -> |
|
|
|
99 -> |
|
|
|
"https://blockscout.com/poa/core/tokens/" |
|
|
|
@blockscout_base_link <> "poa/core/tokens/" |
|
|
|
|
|
|
|
|
|
|
|
77 -> |
|
|
|
77 -> |
|
|
|
"https://blockscout.com/poa/sokol/tokens/" |
|
|
|
@blockscout_base_link <> "poa/sokol/tokens/" |
|
|
|
|
|
|
|
|
|
|
|
42 -> |
|
|
|
42 -> |
|
|
|
"https://kovan.etherscan.io/token/" |
|
|
|
"https://kovan.etherscan.io/token/" |
|
|
@ -95,12 +101,12 @@ defmodule BlockScoutWeb.Tokens.OverviewView do |
|
|
|
"https://goerli.etherscan.io/token/" |
|
|
|
"https://goerli.etherscan.io/token/" |
|
|
|
|
|
|
|
|
|
|
|
1 -> |
|
|
|
1 -> |
|
|
|
"https://etherscan.io/token/" |
|
|
|
@etherscan_token_link |
|
|
|
|
|
|
|
|
|
|
|
_ -> |
|
|
|
_ -> |
|
|
|
"https://etherscan.io/token/" |
|
|
|
@etherscan_token_link |
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
defp get_base_token_explorer_link(_), do: "https://etherscan.io/" |
|
|
|
defp get_base_token_explorer_link(_), do: @etherscan_token_link |
|
|
|
end |
|
|
|
end |
|
|
|