Skip to content
This repository was archived by the owner on Dec 26, 2023. It is now read-only.

Commit abf10d6

Browse files
BrianBrian
authored andcommitted
Re-added constants required for minting
Added Toast message for User cancelled Transaction Added Toast and translation
1 parent 9ba5191 commit abf10d6

File tree

3 files changed

+9
-5
lines changed

3 files changed

+9
-5
lines changed

frontend/public/locales/en/common.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,6 @@
3939
"ddaoTokenVisualizer": "Developer DAO Token Visualizer",
4040
"by": "by",
4141
"otherTokensOwnedByThisAddress":"Other Tokens owned by this address",
42-
"noOtherTokens":"No other tokens owned by this address"
43-
42+
"noOtherTokens":"No other tokens owned by this address",
43+
"userCancelTransaction": "Transaction Cancelled by User"
4444
}

frontend/src/components/DirectMint/DirectMint.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import WalletConnectProvider from '@walletconnect/web3-provider';
1010
import Web3Modal from 'web3modal';
1111
import { useTranslation } from 'next-i18next';
1212
import {
13-
CONTRACT_ADDRESS,
13+
DEVELOPER_DAO_CONTRACT,
1414
ERROR_CODE_TX_REJECTED_BY_USER,
1515
MAINNET_NETWORK_ID,
1616
INFURA_ID,
@@ -58,7 +58,7 @@ const DirectMint = ({ developerId }: DirectMintProps) => {
5858
const _web3 = new ethers.providers.Web3Provider(_provider);
5959
_signer = _web3.getSigner();
6060
mint_contract = new ethers.Contract(
61-
CONTRACT_ADDRESS,
61+
DEVELOPER_DAO_CONTRACT,
6262
MINT_CONTRACT.abi,
6363
_signer,
6464
);
@@ -150,7 +150,7 @@ const DirectMint = ({ developerId }: DirectMintProps) => {
150150
if (error.code === ERROR_CODE_TX_REJECTED_BY_USER) {
151151
// resetFields();
152152
toast({
153-
title: 'Transaction Cancelled by User',
153+
title: t('userCancelTransaction'),
154154
status: 'error',
155155
isClosable: true,
156156
});

frontend/src/utils/DeveloperDaoConstants.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ export const DEVELOPER_DAO_WEBSITE = 'https://www.developerdao.com';
44
export const OPENSEA_DIRECT_LINK_PREFIX = `https://opensea.io/assets/${DEVELOPER_DAO_CONTRACT}`;
55
export const ETHER_SCAN_LINK_PREFIX = 'https://etherscan.io/address';
66
export const SITE_URL = 'https://developerdao.com';
7+
export const ERROR_CODE_TX_REJECTED_BY_USER = 4001;
8+
export const MAINNET_NETWORK_ID = 1;
9+
export const INFURA_ID = '86ddbc7b94ff40af908eaed373ac95d6';
10+
711
export const DEVELOPER_DAO_CONTRACT_ABI = [
812
{ inputs: [], stateMutability: 'nonpayable', type: 'constructor' },
913
{

0 commit comments

Comments
 (0)