Skip to content

Commit

Permalink
feat: modify deploymentplanurl (#85)
Browse files Browse the repository at this point in the history
  • Loading branch information
Polybius93 authored Apr 25, 2024
1 parent 6aade10 commit b21a804
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
5 changes: 3 additions & 2 deletions src/app/hooks/use-ethereum-contracts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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(
Expand Down
3 changes: 1 addition & 2 deletions src/app/hooks/use-ethereum.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit b21a804

Please sign in to comment.