Skip to content

Commit

Permalink
add blockscan url to smart contracts context
Browse files Browse the repository at this point in the history
  • Loading branch information
justinkchen committed Nov 12, 2023
1 parent 1632123 commit d2e3475
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 3 additions & 1 deletion client/src/components/modals/Modal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import { ProofGenerationStatus } from "../ProofGen/types";
import { Button } from "../Button";
import { VerificationStepRow, VerificationState, VerificationStepType } from "./VerificationStepRow";
import { LabeledTextArea } from '../legacy/LabeledTextArea';
import useSmartContracts from "@hooks/useSmartContracts";


interface ModalProps {
Expand Down Expand Up @@ -55,6 +56,7 @@ export const Modal: React.FC<ModalProps> = ({

const { isProvingTypeFast } = useProofGenSettings();
const size = useWindowSize();
const { blockscanUrl } = useSmartContracts();

/*
* State
Expand Down Expand Up @@ -322,7 +324,7 @@ export const Modal: React.FC<ModalProps> = ({

{transactionAddress?.length ? (
<Link
href={`https://goerli.etherscan.io/tx/${transactionAddress}`}
href={`${blockscanUrl}/tx/${transactionAddress}`}
target="_blank"
rel="noopener noreferrer">
<ThemedText.LabelSmall textAlign="left">
Expand Down
2 changes: 2 additions & 0 deletions client/src/contexts/SmartContracts/SmartContractsContext.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ interface SmartContractsValues {
sendProcessorAbi: Abi | null;
usdcAddress: Address | null;
usdcAbi?: Abi | null;
blockscanUrl?: string | null;
}

const defaultValues: SmartContractsValues = {
Expand All @@ -24,6 +25,7 @@ const defaultValues: SmartContractsValues = {
sendProcessorAbi: null,
usdcAddress: null,
usdcAbi: null,
blockscanUrl: 'https://goerli.etherscan.io',
};

const SmartContractsContext = createContext<SmartContractsValues>(defaultValues)
Expand Down

0 comments on commit d2e3475

Please sign in to comment.