Skip to content

Commit

Permalink
feat: remove unused address when registering tokens (#35)
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastiendan authored Nov 22, 2023
1 parent cf26385 commit 2da7342
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
5 changes: 2 additions & 3 deletions packages/frontend/src/hooks/useRegisterToken.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { renderHook } from '@testing-library/react'
import { vi } from 'vitest'

import * as contractExports from '../contracts'
import useRegisterToken, { zeroAddress } from './useRegisterToken'
import useRegisterToken from './useRegisterToken'
import { ethers } from 'ethers'

const deployTokenMock = vi
Expand Down Expand Up @@ -40,12 +40,11 @@ describe('registerToken', () => {
const supply = 1_000

const params = ethers.utils.defaultAbiCoder.encode(
['string', 'string', 'uint256', 'address', 'uint256', 'uint256'],
['string', 'string', 'uint256', 'uint256', 'uint256'],
[
name,
symbol,
ethers.utils.parseUnits(cap.toString()),
zeroAddress,
ethers.utils.parseUnits(dailyMintLimit.toString()),
ethers.utils.parseUnits(supply.toString()),
]
Expand Down
5 changes: 1 addition & 4 deletions packages/frontend/src/hooks/useRegisterToken.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ import { ErrorsContext } from '../contexts/errors'
import { erc20MessagingContract } from '../contracts'
import useEthers from './useEthers'

export const zeroAddress = '0x0000000000000000000000000000000000000000'

export default function useRegisterToken() {
const { provider } = useEthers({
viaMetaMask: true,
Expand All @@ -25,12 +23,11 @@ export default function useRegisterToken() {
setLoading(true)

const params = ethers.utils.defaultAbiCoder.encode(
['string', 'string', 'uint256', 'address', 'uint256', 'uint256'],
['string', 'string', 'uint256', 'uint256', 'uint256'],
[
name,
symbol,
ethers.utils.parseUnits(cap.toString()),
zeroAddress,
ethers.utils.parseUnits(dailyMintLimit.toString()),
ethers.utils.parseUnits(supply.toString()),
]
Expand Down

0 comments on commit 2da7342

Please sign in to comment.