Skip to content

Commit

Permalink
Fix "Link to Deployment in Explorer is Undefined" Issue (#134)
Browse files Browse the repository at this point in the history
This PR updates the logic for constructing the blockchain explorer URL
to dynamically adjust based on the selected blockchain environment
(Milkomeda or Ethereum Classic). The issue was that the deployment link
was not correctly directing users to the appropriate blockchain explorer
for Ethereum Classic.

**Changes Made:**
- Added a conditional check for the REACT_APP_BC environment variable to
determine the active blockchain environment (Milkomeda or Ethereum
Classic).
- Updated the <a> tag to dynamically use the correct explorer URL:
REACT_APP_MILKOMEDA_C1_EXPLORER for Milkomeda.
REACT_APP_EXPLORER for Ethereum Classic.

For Eth-Classic

![image](https://github.com/user-attachments/assets/aa534d85-a3c3-4a1d-8082-f9d513f85146)

For Milkomeda 

![image](https://github.com/user-attachments/assets/7e3fb326-bd64-4248-b1f8-11775fe89552)

Both work perfectly
  • Loading branch information
kumawatkaran523 authored Dec 29, 2024
1 parent 55da788 commit 04a0abe
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 7 deletions.
2 changes: 1 addition & 1 deletion env/milkomeda-testnet.env
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ REACT_APP_CHAIN_ID=200101
REACT_APP_DJED_ADDRESS=0xc4C0669Ea7BFF70A6cFa5905A0Ba487fC181Dc37
REACT_APP_FEE_UI=0
REACT_APP_UI=0x0232556C83791b8291E9b23BfEa7d67405Bd9839
REACT_APP_MILKOMEDA_C1_EXPLORER=https://explorer-devnet-cardano-evm.c1.milkomeda.com/
REACT_APP_EXPLORER=https://explorer-devnet-cardano-evm.c1.milkomeda.com/
REACT_APP_BC=Milkomeda
REACT_APP_PROTOCOL_CHAIN_DESCRIPTION=Milkomeda is the EVM-compatible chain of the Cardano ecosystem. Its native currency is mADA, a bridged version of Cardano`s ADA
REACT_APP_CHAIN_COIN=mADA
Expand Down
2 changes: 1 addition & 1 deletion env/milkomeda.env
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ REACT_APP_CHAIN_ID=2001
REACT_APP_DJED_ADDRESS=0x67A30B399F5Ed499C1a6Bc0358FA6e42Ea4BCe76
REACT_APP_FEE_UI=0.01
REACT_APP_UI=0x6AfD84920971Ba96118a302deaA6d11e7ce18b03
REACT_APP_MILKOMEDA_C1_EXPLORER=https://explorer-mainnet-cardano-evm.c1.milkomeda.com/
REACT_APP_EXPLORER=https://explorer-mainnet-cardano-evm.c1.milkomeda.com/
REACT_APP_BC=Milkomeda
REACT_APP_PROTOCOL_CHAIN_DESCRIPTION=Milkomeda is the EVM-compatible chain of the Cardano ecosystem. Its native currency is mADA, a bridged version of Cardano`s ADA
REACT_APP_CHAIN_COIN=mADA
Expand Down
10 changes: 6 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
"aria-query": "^5.3.0",
"assert": "^2.0.0",
"bignumber.js": "^9.1.1",
"caniuse-lite": "^1.0.30001690",
"ethers": "^5.7.2",
"milkomeda-wsc-ui-test-beta": "1.0.20",
"react": "^17.0.2",
Expand Down
2 changes: 1 addition & 1 deletion src/routes/protocol.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ export default function Protocol() {
</a>
. Here you can interact with a{" "}
<a
href={`${process.env.REACT_APP_MILKOMEDA_C1_EXPLORER}/address/${process.env.REACT_APP_DJED_ADDRESS}`}
href={`${process.env.REACT_APP_EXPLORER}/address/${process.env.REACT_APP_DJED_ADDRESS}`}
target="_blank"
rel="noreferrer"
>
Expand Down

0 comments on commit 04a0abe

Please sign in to comment.