Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
I
interface
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
LuckySwap
interface
Commits
ec831f84
Unverified
Commit
ec831f84
authored
Mar 29, 2022
by
Zach Pomerantz
Committed by
GitHub
Mar 29, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
chore: destructure json imports (#3622)
parent
56bd9b68
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
6 additions
and
16 deletions
+6
-16
usePools.ts
src/hooks/usePools.ts
+1
-3
useV2Pairs.ts
src/hooks/useV2Pairs.ts
+1
-3
hooks.ts
src/state/claim/hooks.ts
+1
-3
hooks.ts
src/state/governance/hooks.ts
+2
-5
hooks.tsx
src/state/stake/hooks.tsx
+1
-2
No files found.
src/hooks/usePools.ts
View file @
ec831f84
import
{
Interface
}
from
'
@ethersproject/abi
'
import
{
Interface
}
from
'
@ethersproject/abi
'
import
{
BigintIsh
,
Currency
,
Token
}
from
'
@uniswap/sdk-core
'
import
{
BigintIsh
,
Currency
,
Token
}
from
'
@uniswap/sdk-core
'
import
IUniswapV3PoolStateJson
from
'
@uniswap/v3-core/artifacts/contracts/interfaces/pool/IUniswapV3PoolState.sol/IUniswapV3PoolState.json
'
import
{
abi
as
IUniswapV3PoolStateABI
}
from
'
@uniswap/v3-core/artifacts/contracts/interfaces/pool/IUniswapV3PoolState.sol/IUniswapV3PoolState.json
'
import
{
computePoolAddress
}
from
'
@uniswap/v3-sdk
'
import
{
computePoolAddress
}
from
'
@uniswap/v3-sdk
'
import
{
FeeAmount
,
Pool
}
from
'
@uniswap/v3-sdk
'
import
{
FeeAmount
,
Pool
}
from
'
@uniswap/v3-sdk
'
import
useActiveWeb3React
from
'
hooks/useActiveWeb3React
'
import
useActiveWeb3React
from
'
hooks/useActiveWeb3React
'
...
@@ -11,8 +11,6 @@ import { useMemo } from 'react'
...
@@ -11,8 +11,6 @@ import { useMemo } from 'react'
import
{
V3_CORE_FACTORY_ADDRESSES
}
from
'
../constants/addresses
'
import
{
V3_CORE_FACTORY_ADDRESSES
}
from
'
../constants/addresses
'
import
{
IUniswapV3PoolStateInterface
}
from
'
../types/v3/IUniswapV3PoolState
'
import
{
IUniswapV3PoolStateInterface
}
from
'
../types/v3/IUniswapV3PoolState
'
const
{
abi
:
IUniswapV3PoolStateABI
}
=
IUniswapV3PoolStateJson
const
POOL_STATE_INTERFACE
=
new
Interface
(
IUniswapV3PoolStateABI
)
as
IUniswapV3PoolStateInterface
const
POOL_STATE_INTERFACE
=
new
Interface
(
IUniswapV3PoolStateABI
)
as
IUniswapV3PoolStateInterface
// Classes are expensive to instantiate, so this caches the recently instantiated pools.
// Classes are expensive to instantiate, so this caches the recently instantiated pools.
...
...
src/hooks/useV2Pairs.ts
View file @
ec831f84
import
{
Interface
}
from
'
@ethersproject/abi
'
import
{
Interface
}
from
'
@ethersproject/abi
'
import
{
Currency
,
CurrencyAmount
}
from
'
@uniswap/sdk-core
'
import
{
Currency
,
CurrencyAmount
}
from
'
@uniswap/sdk-core
'
import
IUniswapV2PairJson
from
'
@uniswap/v2-core/build/IUniswapV2Pair.json
'
import
{
abi
as
IUniswapV2PairABI
}
from
'
@uniswap/v2-core/build/IUniswapV2Pair.json
'
import
{
computePairAddress
,
Pair
}
from
'
@uniswap/v2-sdk
'
import
{
computePairAddress
,
Pair
}
from
'
@uniswap/v2-sdk
'
import
{
useMultipleContractSingleData
}
from
'
lib/hooks/multicall
'
import
{
useMultipleContractSingleData
}
from
'
lib/hooks/multicall
'
import
{
useMemo
}
from
'
react
'
import
{
useMemo
}
from
'
react
'
import
{
V2_FACTORY_ADDRESSES
}
from
'
../constants/addresses
'
import
{
V2_FACTORY_ADDRESSES
}
from
'
../constants/addresses
'
const
{
abi
:
IUniswapV2PairABI
}
=
IUniswapV2PairJson
const
PAIR_INTERFACE
=
new
Interface
(
IUniswapV2PairABI
)
const
PAIR_INTERFACE
=
new
Interface
(
IUniswapV2PairABI
)
export
enum
PairState
{
export
enum
PairState
{
...
...
src/state/claim/hooks.ts
View file @
ec831f84
import
{
TransactionResponse
}
from
'
@ethersproject/providers
'
import
{
TransactionResponse
}
from
'
@ethersproject/providers
'
import
MerkleDistributorJson
from
'
@uniswap/merkle-distributor/build/MerkleDistributor.json
'
import
{
abi
as
MERKLE_DISTRIBUTOR_ABI
}
from
'
@uniswap/merkle-distributor/build/MerkleDistributor.json
'
import
{
CurrencyAmount
,
Token
}
from
'
@uniswap/sdk-core
'
import
{
CurrencyAmount
,
Token
}
from
'
@uniswap/sdk-core
'
import
{
MERKLE_DISTRIBUTOR_ADDRESS
}
from
'
constants/addresses
'
import
{
MERKLE_DISTRIBUTOR_ADDRESS
}
from
'
constants/addresses
'
import
useActiveWeb3React
from
'
hooks/useActiveWeb3React
'
import
useActiveWeb3React
from
'
hooks/useActiveWeb3React
'
...
@@ -14,8 +14,6 @@ import { calculateGasMargin } from '../../utils/calculateGasMargin'
...
@@ -14,8 +14,6 @@ import { calculateGasMargin } from '../../utils/calculateGasMargin'
import
{
TransactionType
}
from
'
../transactions/actions
'
import
{
TransactionType
}
from
'
../transactions/actions
'
import
{
useTransactionAdder
}
from
'
../transactions/hooks
'
import
{
useTransactionAdder
}
from
'
../transactions/hooks
'
const
{
abi
:
MERKLE_DISTRIBUTOR_ABI
}
=
MerkleDistributorJson
function
useMerkleDistributorContract
()
{
function
useMerkleDistributorContract
()
{
return
useContract
(
MERKLE_DISTRIBUTOR_ADDRESS
,
MERKLE_DISTRIBUTOR_ABI
,
true
)
return
useContract
(
MERKLE_DISTRIBUTOR_ADDRESS
,
MERKLE_DISTRIBUTOR_ABI
,
true
)
}
}
...
...
src/state/governance/hooks.ts
View file @
ec831f84
...
@@ -5,8 +5,8 @@ import { TransactionResponse } from '@ethersproject/providers'
...
@@ -5,8 +5,8 @@ import { TransactionResponse } from '@ethersproject/providers'
import
{
toUtf8String
,
Utf8ErrorFuncs
,
Utf8ErrorReason
}
from
'
@ethersproject/strings
'
import
{
toUtf8String
,
Utf8ErrorFuncs
,
Utf8ErrorReason
}
from
'
@ethersproject/strings
'
// eslint-disable-next-line no-restricted-imports
// eslint-disable-next-line no-restricted-imports
import
{
t
}
from
'
@lingui/macro
'
import
{
t
}
from
'
@lingui/macro
'
import
GovernorAlphaJson
from
'
@uniswap/governance/build/GovernorAlpha.json
'
import
{
abi
as
GOVERNANCE_ABI
}
from
'
@uniswap/governance/build/GovernorAlpha.json
'
import
UniJson
from
'
@uniswap/governance/build/Uni.json
'
import
{
abi
as
UNI_ABI
}
from
'
@uniswap/governance/build/Uni.json
'
import
{
CurrencyAmount
,
Token
}
from
'
@uniswap/sdk-core
'
import
{
CurrencyAmount
,
Token
}
from
'
@uniswap/sdk-core
'
import
{
ChainId
}
from
'
@uniswap/smart-order-router
'
import
{
ChainId
}
from
'
@uniswap/smart-order-router
'
import
GOVERNOR_BRAVO_ABI
from
'
abis/governor-bravo.json
'
import
GOVERNOR_BRAVO_ABI
from
'
abis/governor-bravo.json
'
...
@@ -37,9 +37,6 @@ import { TransactionType } from '../transactions/actions'
...
@@ -37,9 +37,6 @@ import { TransactionType } from '../transactions/actions'
import
{
useTransactionAdder
}
from
'
../transactions/hooks
'
import
{
useTransactionAdder
}
from
'
../transactions/hooks
'
import
{
VoteOption
}
from
'
./types
'
import
{
VoteOption
}
from
'
./types
'
const
{
abi
:
GOVERNANCE_ABI
}
=
GovernorAlphaJson
const
{
abi
:
UNI_ABI
}
=
UniJson
function
useGovernanceV0Contract
():
Contract
|
null
{
function
useGovernanceV0Contract
():
Contract
|
null
{
return
useContract
(
GOVERNANCE_ALPHA_V0_ADDRESSES
,
GOVERNANCE_ABI
,
false
)
return
useContract
(
GOVERNANCE_ALPHA_V0_ADDRESSES
,
GOVERNANCE_ABI
,
false
)
}
}
...
...
src/state/stake/hooks.tsx
View file @
ec831f84
import
{
Interface
}
from
'
@ethersproject/abi
'
import
{
Interface
}
from
'
@ethersproject/abi
'
import
{
Trans
}
from
'
@lingui/macro
'
import
{
Trans
}
from
'
@lingui/macro
'
import
StakingRewardsJson
from
'
@uniswap/liquidity-staker/build/StakingRewards.json
'
import
{
abi
as
STAKING_REWARDS_ABI
}
from
'
@uniswap/liquidity-staker/build/StakingRewards.json
'
import
{
CurrencyAmount
,
Token
}
from
'
@uniswap/sdk-core
'
import
{
CurrencyAmount
,
Token
}
from
'
@uniswap/sdk-core
'
import
{
Pair
}
from
'
@uniswap/v2-sdk
'
import
{
Pair
}
from
'
@uniswap/v2-sdk
'
import
{
SupportedChainId
}
from
'
constants/chains
'
import
{
SupportedChainId
}
from
'
constants/chains
'
...
@@ -13,7 +13,6 @@ import { ReactNode, useMemo } from 'react'
...
@@ -13,7 +13,6 @@ import { ReactNode, useMemo } from 'react'
import
{
DAI
,
UNI
,
USDC_MAINNET
,
USDT
,
WBTC
,
WRAPPED_NATIVE_CURRENCY
}
from
'
../../constants/tokens
'
import
{
DAI
,
UNI
,
USDC_MAINNET
,
USDT
,
WBTC
,
WRAPPED_NATIVE_CURRENCY
}
from
'
../../constants/tokens
'
const
{
abi
:
STAKING_REWARDS_ABI
}
=
StakingRewardsJson
const
STAKING_REWARDS_INTERFACE
=
new
Interface
(
STAKING_REWARDS_ABI
)
const
STAKING_REWARDS_INTERFACE
=
new
Interface
(
STAKING_REWARDS_ABI
)
export
const
STAKING_GENESIS
=
1600387200
export
const
STAKING_GENESIS
=
1600387200
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment