Skip to content

Commit 05fb778

Browse files
committed
fix: remove un-used types
1 parent b489231 commit 05fb778

3 files changed

Lines changed: 2 additions & 57 deletions

File tree

apps/frontend/src/app/3_organisms/ERC20BridgeDialog/hooks/useBridge.ts

Lines changed: 1 addition & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,7 @@ import { useCallback, useState, useEffect, useMemo } from 'react';
44

55
import { ethers } from 'ethers';
66

7-
import { ChainIds } from '@sovryn/ethers-provider';
8-
import {
9-
BridgeParams,
10-
BridgeTransaction,
11-
CrossBridgeAsset,
12-
TxStep,
13-
} from '@sovryn/sdk';
7+
import { BridgeParams, BridgeTransaction, TxStep } from '@sovryn/sdk';
148

159
import { useAccount } from '../../../../hooks';
1610
import { useBridgeService } from './useBridgeService';
@@ -104,32 +98,6 @@ export function useBridge({
10498
setTransaction({ step: TxStep.APPROVING });
10599

106100
try {
107-
// Special handling for USDT on ETH (reset allowance to 0 first)
108-
if (
109-
[ChainIds.MAINNET, ChainIds.ROPSTEN].includes(
110-
sourceChain as ChainIds,
111-
) &&
112-
asset === CrossBridgeAsset.USDT
113-
) {
114-
const currentAllowance = await bridgeService.getAllowance(
115-
sourceChain,
116-
asset,
117-
account!,
118-
spenderAddress,
119-
);
120-
121-
if (currentAllowance !== '0') {
122-
const resetTx = await bridgeService.approve(
123-
sourceChain,
124-
asset,
125-
spenderAddress,
126-
'0',
127-
signer,
128-
);
129-
await resetTx.wait();
130-
}
131-
}
132-
133101
const tx = await bridgeService.approve(
134102
sourceChain,
135103
asset,
@@ -166,7 +134,6 @@ export function useBridge({
166134
asset,
167135
amount,
168136
refetchAllowance,
169-
account,
170137
]);
171138

172139
const handleBridge = useCallback(async (): Promise<void> => {

packages/sdk/src/bridge/config/assets.ts

Lines changed: 1 addition & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { AssetConfig, CrossBridgeAsset } from '../types';
1+
import { AssetConfig } from '../types';
22

33
// Aggregator addresses
44
export const aggregators = {
@@ -24,7 +24,6 @@ export const bscToRskMainnetAssets: AssetConfig[] = [
2424
usesAggregator: true,
2525
aggregatorContractAddress: aggregators.mainnet.bnbs,
2626
bridgeTokenAddress: '0xB6C313a427fa911A4C9a119e80Feea0fe20E69F0',
27-
allowedTargets: [CrossBridgeAsset.BNBS],
2827
},
2928
{
3029
symbol: 'ETH',
@@ -33,7 +32,6 @@ export const bscToRskMainnetAssets: AssetConfig[] = [
3332
isBase: false,
3433
usesAggregator: true,
3534
aggregatorContractAddress: aggregators.mainnet.eths,
36-
allowedTargets: [CrossBridgeAsset.ETHS],
3735
},
3836
];
3937

@@ -47,10 +45,6 @@ export const rskToBscMainnetAssets: AssetConfig[] = [
4745
usesAggregator: true,
4846
aggregatorContractAddress: aggregators.mainnet.bnbs,
4947
bridgeTokenAddress: '0xd2a826b78200c8434b957913ce4067e6e3169385',
50-
allowedTargets: [CrossBridgeAsset.BNB],
51-
targetContracts: new Map([
52-
[CrossBridgeAsset.BNB, '0xd2a826b78200c8434b957913ce4067e6e3169385'],
53-
]),
5448
},
5549
{
5650
symbol: 'ETH',
@@ -60,10 +54,6 @@ export const rskToBscMainnetAssets: AssetConfig[] = [
6054
usesAggregator: true,
6155
aggregatorContractAddress: aggregators.mainnet.eths,
6256
bridgeTokenAddress: '0x30d1B36924c2c0CD1c03EC257D7FFf31bD8c3007',
63-
allowedTargets: [CrossBridgeAsset.ETH],
64-
targetContracts: new Map([
65-
[CrossBridgeAsset.ETH, '0x30d1B36924c2c0CD1c03EC257D7FFf31bD8c3007'],
66-
]),
6757
},
6858
];
6959

@@ -137,7 +127,6 @@ export const bscToRskTestnetAssets: AssetConfig[] = [
137127
usesAggregator: true,
138128
aggregatorContractAddress: aggregators.testnet.bnbs,
139129
bridgeTokenAddress: '0x68bD35422b457f315AA176743325a9F7C9830c68',
140-
allowedTargets: [CrossBridgeAsset.BNBS],
141130
},
142131
{
143132
symbol: 'ETH',
@@ -146,7 +135,6 @@ export const bscToRskTestnetAssets: AssetConfig[] = [
146135
isBase: false,
147136
usesAggregator: true,
148137
aggregatorContractAddress: aggregators.testnet.eths,
149-
allowedTargets: [CrossBridgeAsset.ETHS],
150138
},
151139
];
152140

@@ -160,10 +148,6 @@ export const rskToBscTestnetAssets: AssetConfig[] = [
160148
usesAggregator: true,
161149
aggregatorContractAddress: aggregators.testnet.bnbs,
162150
bridgeTokenAddress: '0xafa6A1eb7E2282E8854822d2bB412b6db2cabA4E',
163-
allowedTargets: [CrossBridgeAsset.BNB],
164-
targetContracts: new Map([
165-
[CrossBridgeAsset.BNB, '0xafa6A1eb7E2282E8854822d2bB412b6db2cabA4E'],
166-
]),
167151
},
168152
{
169153
symbol: 'ETH',
@@ -173,9 +157,5 @@ export const rskToBscTestnetAssets: AssetConfig[] = [
173157
usesAggregator: true,
174158
aggregatorContractAddress: aggregators.testnet.eths,
175159
bridgeTokenAddress: '0x793CE6F95912D5b43532c2116e1b68993d902272',
176-
allowedTargets: [CrossBridgeAsset.ETH],
177-
targetContracts: new Map([
178-
[CrossBridgeAsset.ETH, '0x793CE6F95912D5b43532c2116e1b68993d902272'],
179-
]),
180160
},
181161
];

packages/sdk/src/bridge/types.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,6 @@ export interface AssetConfig {
4343
usesAggregator: boolean;
4444
aggregatorContractAddress?: string;
4545
bridgeTokenAddress?: string;
46-
allowedTargets?: CrossBridgeAsset[];
47-
targetContracts?: Map<CrossBridgeAsset, string>;
4846
}
4947

5048
export interface BridgeConfig {

0 commit comments

Comments
 (0)