Skip to content

Commit

Permalink
fix: typed permit chains (Uniswap#393)
Browse files Browse the repository at this point in the history
  • Loading branch information
zzmp authored Feb 1, 2023
1 parent c7a560b commit ca3ac72
Showing 1 changed file with 11 additions and 10 deletions.
21 changes: 11 additions & 10 deletions src/hooks/usePermit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { BigNumber } from '@ethersproject/bignumber'
import { splitSignature } from '@ethersproject/bytes'
import { Currency, CurrencyAmount } from '@uniswap/sdk-core'
import { useWeb3React } from '@web3-react/core'
import { SupportedChainId } from 'constants/chains'
import { DAI, UNI, USDC_MAINNET } from 'constants/tokens'
import { useSingleCallResult } from 'hooks/multicall'
import JSBI from 'jsbi'
Expand Down Expand Up @@ -31,24 +32,24 @@ const PERMITTABLE_TOKENS: {
[checksummedTokenAddress: string]: PermitInfo
}
} = {
1: {
[SupportedChainId.MAINNET]: {
[USDC_MAINNET.address]: { type: PermitType.AMOUNT, name: 'USD Coin', version: '2' },
[DAI.address]: { type: PermitType.ALLOWED, name: 'Dai Stablecoin', version: '1' },
[UNI[1].address]: { type: PermitType.AMOUNT, name: 'Uniswap' },
[UNI[SupportedChainId.MAINNET].address]: { type: PermitType.AMOUNT, name: 'Uniswap' },
},
4: {
[SupportedChainId.RINKEBY]: {
'0xc7AD46e0b8a400Bb3C915120d284AafbA8fc4735': { type: PermitType.ALLOWED, name: 'Dai Stablecoin', version: '1' },
[UNI[4].address]: { type: PermitType.AMOUNT, name: 'Uniswap' },
[UNI[SupportedChainId.RINKEBY].address]: { type: PermitType.AMOUNT, name: 'Uniswap' },
},
3: {
[UNI[3].address]: { type: PermitType.AMOUNT, name: 'Uniswap' },
[SupportedChainId.ROPSTEN]: {
[UNI[SupportedChainId.ROPSTEN].address]: { type: PermitType.AMOUNT, name: 'Uniswap' },
'0x07865c6E87B9F70255377e024ace6630C1Eaa37F': { type: PermitType.AMOUNT, name: 'USD Coin', version: '2' },
},
5: {
[UNI[5].address]: { type: PermitType.AMOUNT, name: 'Uniswap' },
[SupportedChainId.GOERLI]: {
[UNI[SupportedChainId.GOERLI].address]: { type: PermitType.AMOUNT, name: 'Uniswap' },
},
42: {
[UNI[42].address]: { type: PermitType.AMOUNT, name: 'Uniswap' },
[SupportedChainId.KOVAN]: {
[UNI[SupportedChainId.KOVAN].address]: { type: PermitType.AMOUNT, name: 'Uniswap' },
},
}

Expand Down

0 comments on commit ca3ac72

Please sign in to comment.