Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CLI utility shows wrong etherscan links when generating tx #953

Closed
chrismaree opened this issue Feb 21, 2020 · 2 comments · Fixed by #951
Closed

CLI utility shows wrong etherscan links when generating tx #953

chrismaree opened this issue Feb 21, 2020 · 2 comments · Fixed by #951
Labels
enhancement New feature or request
Milestone

Comments

@chrismaree
Copy link
Member

Right now the CLI utility always generates a link to etherscan.io, even if running on test net or local.
image
This should dynamically change based on the network.

@chrismaree chrismaree added the enhancement New feature or request label Feb 21, 2020
@mrice32
Copy link
Member

mrice32 commented Feb 21, 2020

Agreed, we have a common lib that should help with that:

module.exports = {
1: {
name: "mainnet",
ethFaucet: null,
etherscan: "https://etherscan.io/",
daiAddress: "0x89d24A6b4CcB1B6fAA2625fE562bDD9a23260359"
},
3: {
name: "ropsten",
ethFaucet: "https://faucet.metamask.io/",
etherscan: "https://ropsten.etherscan.io/",
daiAddress: "0xB5E5D0F8C0cbA267CD3D7035d6AdC8eBA7Df7Cdd"
},
4: {
name: "rinkeby",
ethFaucet: "https://faucet.rinkeby.io/",
etherscan: "https://rinkeby.etherscan.io/",
daiAddress: "0x5592EC0cfb4dbc12D3aB100b257153436a1f0FEa"
},
42: {
name: "kovan",
ethFaucet: "https://faucet.kovan.network/",
etherscan: "https://kovan.etherscan.io/",
daiAddress: "0xbF7A7169562078c96f0eC1A8aFD6aE50f12e5A99"
}
};

We use it in the sponsor dapp to generate etherscan links:

export function useEtherscanUrl() {
const networkId = drizzleReactHooks.useDrizzleState(drizzleState => {
return drizzleState.web3.networkId;
});
const networkConfig = publicNetworks[networkId];
if (networkConfig && networkConfig.etherscan) {
return networkConfig.etherscan;
}
// Default to mainnet, even though it won't work for ganache runs.
return "https://etherscan.io/";
}

@mrice32 mrice32 added this to the Voting CLI milestone Feb 21, 2020
@nicholaspai
Copy link
Member

Added a fix for this in #951

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants