From 1a6001316cc134601a58c4e9a65d40fa5f8e090d Mon Sep 17 00:00:00 2001 From: Polybius93 Date: Thu, 25 Apr 2024 16:15:04 +0200 Subject: [PATCH] feat: modify deploymentplanurl --- src/app/hooks/use-ethereum-contracts.ts | 5 +++-- src/app/hooks/use-ethereum.ts | 3 +-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/app/hooks/use-ethereum-contracts.ts b/src/app/hooks/use-ethereum-contracts.ts index 55794cb8..980d2367 100644 --- a/src/app/hooks/use-ethereum-contracts.ts +++ b/src/app/hooks/use-ethereum-contracts.ts @@ -5,6 +5,8 @@ import { EthereumError } from '@models/error-types'; import { EthereumNetwork } from '@models/ethereum-network'; import { Contract, ethers } from 'ethers'; +const SOLIDITY_CONTRACT_URL = 'https://raw.githubusercontent.com/DLC-link/dlc-solidity'; + interface UseEthereumContractsReturnType { getEthereumContracts: ( ethereumSigner: ethers.providers.JsonRpcSigner, @@ -90,8 +92,7 @@ export function useEthereumContracts(): UseEthereumContractsReturnType { ethereumNetwork: EthereumNetwork ) { const branchName = import.meta.env.VITE_ETHEREUM_DEPLOYMENT_BRANCH; - const contractVersion = import.meta.env.VITE_ETHEREUM_DEPLOYMENT_VERSION; - const deploymentPlanURL = `https://raw.githubusercontent.com/DLC-link/dlc-solidity/${branchName}/deploymentFiles/${ethereumNetwork.name.toLowerCase()}/v${contractVersion}/${contractName}.json`; + const deploymentPlanURL = `${SOLIDITY_CONTRACT_URL}/${branchName}/deploymentFiles/${ethereumNetwork.name.toLowerCase()}/${contractName}.json`; // eslint-disable-next-line no-console console.log( diff --git a/src/app/hooks/use-ethereum.ts b/src/app/hooks/use-ethereum.ts index 1c3e98c1..891382f6 100644 --- a/src/app/hooks/use-ethereum.ts +++ b/src/app/hooks/use-ethereum.ts @@ -73,9 +73,8 @@ export function useEthereum(): UseEthereumReturnType { const provider = ethers.providers.getDefaultProvider(ethereumNetwork.defaultNodeURL); const deploymentBranchName = import.meta.env.VITE_ETHEREUM_DEPLOYMENT_BRANCH; - const contractVersion = import.meta.env.VITE_ETHEREUM_DEPLOYMENT_VERSION; - const deploymentPlanURL = `${SOLIDITY_CONTRACT_URL}/${deploymentBranchName}/deploymentFiles/${ethereumNetworkName}/v${contractVersion}/${contractName}.json`; + const deploymentPlanURL = `${SOLIDITY_CONTRACT_URL}/${deploymentBranchName}/deploymentFiles/${ethereumNetworkName}/${contractName}.json`; const response = await fetch(deploymentPlanURL); const contractData = await response.json();