Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions ethtx_ce/frontend/templates/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,8 @@
<option value="mainnet">ETH mainnet</option>
<option value="goerli">Goerli testnet</option>
<option value="rinkeby">Rinkeby testnet</option>
<option value="fantom">Fantom mainnet</option>
<option value="fantom_testnet">Fantom testnet</option>
</select>
</div>
<div>
Expand Down
2 changes: 2 additions & 0 deletions ethtx_ce/frontend/templates/semantics.html
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,8 @@ <h3>Semantics for: {{address}} / {{ metadata.chain }}</h3>
<option {% if metadata.chain == 'mainnet' %} selected {% endif %} value="mainnet">ETH mainnet</option>
<option {% if metadata.chain == 'goerli' %} selected {% endif %} value="goerli">Goerli testnet</option>
<option {% if metadata.chain == 'rinkeby' %} selected {% endif %} value="rinkeby">Rinkeby testnet</option>
<option {% if metadata.chain == 'fantom' %} selected {% endif %} value="fantom">Fantom mainnet</option>
<option {% if metadata.chain == 'fantom_testnet' %} selected {% endif %} value="fantom_testnet">Fantom testnet</option>
</select>
<label for="name">Contract name</label>
<input type="text" name="name" id="name" class="text ui-widget-content ui-corner-all">
Expand Down
12 changes: 10 additions & 2 deletions ethtx_ce/frontend/templates/transaction.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,17 @@
~ limitations under the License.
-->

{% macro block_explorer_link(chain_id) %}
{%- if chain_id.startswith("fantom") -%}
https://{%- if chain_id == 'fantom_testnet' -%}testnet.{% endif %}ftmscan.io/
{% else %}
https://{%- if chain_id != 'mainnet' -%}{{ chain_id }}.{% endif %}etherscan.io/
{% endif %}
{% endmacro %}

{% macro address_link(address, label, badge="") %}
{%- if address and address != '0x0000000000000000000000000000000000000000' -%}
<a href="https://{%- if transaction.chain_id != 'mainnet' -%}{{ transaction.chain_id }}.{% endif %}etherscan.io/address/{{ address }}" target="_blank">
<a href="{{ block_explorer_link(transaction.chain_id) }}address/{{ address }}" target="_blank">
{%- if badge -%}
<span class="badge badge-info">[{{ badge }}] </span>
{%- endif -%}
Expand All @@ -27,7 +35,7 @@

{% macro nft_link(address, label) %}
{%- if address and address != '0x0000000000000000000000000000000000000000' -%}
<a href="https://{%- if transaction.chain_id != 'mainnet' -%}{{ transaction.chain_id }}.{% endif %}etherscan.io/token/{{ address }}" target="_blank">
<a href="{{ block_explorer_link(transaction.chain_id) }}token/{{ address }}" target="_blank">
{{- label -}}
</a>
{%- else -%}
Expand Down
4 changes: 4 additions & 0 deletions wsgi.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,16 @@
"mainnet": dict(hook=os.getenv("MAINNET_NODE_URL", ""), poa=False),
"goerli": dict(hook=os.getenv("GOERLI_NODE_URL", ""), poa=True),
"rinkeby": dict(hook=os.getenv("RINKEBY_NODE_URL", ""), poa=True),
"fantom": dict(hook=os.getenv("FANTOM_NODE_URL", ""), poa=True),
"fantom_testnet": dict(hook=os.getenv("FANTOM_TESTNET_NODE_URL", ""), poa=True),
},
default_chain="mainnet",
etherscan_urls={
"mainnet": "https://api.etherscan.io/api",
"goerli": "https://api-goerli.etherscan.io/api",
"rinkeby": "https://api-rinkeby.etherscan.io/api",
"fantom": "https://api.fmtscan.com/api",
"fantom_testnet": "https://api-testnet.ftmscan.com/api",
},
)

Expand Down