Skip to content

Commit d19093f

Browse files
committed
chore: fix rusdt migrations
1 parent 996a966 commit d19093f

7 files changed

Lines changed: 76 additions & 14 deletions

File tree

apps/frontend/src/app/2_molecules/RusdtMigrationNotice/RusdtMigrationNotice.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ export const RusdtMigrationNotice: FC<RusdtMigrationNoticeProps> = ({
6262
weiBalance: migrationUsdtBalanceWei,
6363
loading: migrationBalanceLoading,
6464
} = useAssetBalance(
65-
COMMON_SYMBOLS.USDT,
65+
COMMON_SYMBOLS.USDT0,
6666
RSK_CHAIN_ID,
6767
RUSDT_MIGRATION_ALLOWANCE_PROVIDER,
6868
);
@@ -80,7 +80,7 @@ export const RusdtMigrationNotice: FC<RusdtMigrationNoticeProps> = ({
8080
try {
8181
setMigrationAllowanceLoading(true);
8282
const { contract } = await getAssetData(
83-
COMMON_SYMBOLS.USDT,
83+
COMMON_SYMBOLS.USDT0,
8484
RSK_CHAIN_ID,
8585
);
8686
const usdtContract = contract(getProvider(RSK_CHAIN_ID));
@@ -277,7 +277,7 @@ export const RusdtMigrationNotice: FC<RusdtMigrationNoticeProps> = ({
277277
&nbsp;&nbsp;-&gt;&nbsp;&nbsp;
278278
<AmountRenderer
279279
value={account ? decimalic(maxOutputWeiAmount).toUnits(6) : '0'}
280-
suffix={COMMON_SYMBOLS.USDT}
280+
suffix={COMMON_SYMBOLS.USDT0}
281281
isAnimated
282282
/>
283283
</Paragraph>
@@ -291,7 +291,7 @@ export const RusdtMigrationNotice: FC<RusdtMigrationNoticeProps> = ({
291291
<MaxButton
292292
onClick={handleSetMaxAmount}
293293
value={maxMigratableAmount}
294-
token={COMMON_SYMBOLS.SOV}
294+
token={COMMON_SYMBOLS.RUSDT}
295295
/>
296296
</div>
297297

apps/frontend/src/app/5_pages/PortfolioPage/components/AssetSection/components/AssetBalanceRow/AssetBalanceRow.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ export const AssetBalanceRow: FC<AssetBalanceRowProps> = ({
7979
showLongName
8080
assetLongNameClassName="hidden lg:block"
8181
>
82-
{isDeprecated && (
82+
{isDeprecated ? (
8383
<div className="flex flex-wrap items-center gap-1.5">
8484
<span className="flex items-center gap-1 text-gray-40 font-medium text-[10px]">
8585
{prettyTx(asset.address)}
@@ -95,6 +95,8 @@ export const AssetBalanceRow: FC<AssetBalanceRowProps> = ({
9595
/>
9696
)}
9797
</div>
98+
) : (
99+
<>{isRskRusdtAsset && <RusdtMigrationNotice />}</>
98100
)}
99101
</AssetRenderer>
100102
<Paragraph className="text-right lg:text-left truncate">

apps/frontend/src/constants/tokens.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ export const getTokenDisplayNameByAddress = (
2222
(fallbackPrettified ? prettyTx(address) : address);
2323

2424
export const getBobDeprecatedAssetTooltips = (asset: string) => {
25-
if (asset.toUpperCase() === COMMON_SYMBOLS.USDT) {
25+
if (asset.toUpperCase() === COMMON_SYMBOLS.USDT0) {
2626
return {
2727
pool: t(translations.ambientMarketMaking.deprecatedTooltips.usdt.pool),
2828
convert: t(
@@ -50,12 +50,12 @@ export const getBobDeprecatedAssetTooltips = (asset: string) => {
5050
};
5151

5252
export const getRskDeprecatedAssetTooltips = (asset: string) => {
53-
if (asset.toUpperCase() === COMMON_SYMBOLS.RUSDT) {
54-
return {
55-
pool: t(translations.rusdtMigration.notice),
56-
convert: t(translations.rusdtMigration.convertNotice),
57-
};
58-
}
53+
// if (asset.toUpperCase() === COMMON_SYMBOLS.RUSDT) {
54+
// return {
55+
// pool: t(translations.rusdtMigration.notice),
56+
// convert: t(translations.rusdtMigration.convertNotice),
57+
// };
58+
// }
5959

6060
if (['POWA'].includes(asset.toUpperCase())) {
6161
return {

apps/frontend/src/locales/en/translations.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1934,7 +1934,7 @@
19341934
"convertNotice": "The RUSDT pool is deprecated due to migration to USDT0.",
19351935
"modal": {
19361936
"title": "Migrate RUSDT to USDT0",
1937-
"description": "Enter the amount of RUSDT you want to migrate to USDT0 using the Rootstock migration contract.",
1937+
"description": "Enter the amount of RUSDT you want to migrate 1:1 to USDT0",
19381938
"currentBalance": "Current RUSDT balance",
19391939
"maxMigratable": "Max migratable now",
19401940
"amount": "Amount to migrate",

apps/frontend/src/utils/asset.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ export const COMMON_SYMBOLS = {
3636
RUSDT: 'RUSDT',
3737
ETH: 'ETH',
3838
WBTC_OLD: 'WBTC.OLD',
39-
USDT: 'USDT',
39+
USDT0: 'USDT0',
4040
};
4141

4242
export const compareAssets = (asset1?: string | null, asset2?: string | null) =>

packages/contracts/src/contracts/assets/icons/rsk/usdt0.ts

Lines changed: 54 additions & 0 deletions
Large diffs are not rendered by default.

packages/contracts/src/contracts/assets/rsk.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,12 @@ export const rsk: Array<AssetDetails> = [
112112
decimals: 18,
113113
getIcon: async () => (await import('./icons/rsk/rusdt')).default,
114114
},
115+
{
116+
symbol: 'USDT0',
117+
address: '0x779dED0C9e1022225F8e0630b35A9B54Be713736',
118+
decimals: 6,
119+
getIcon: async () => (await import('./icons/rsk/usdt0')).default,
120+
},
115121
{
116122
symbol: 'MYNT',
117123
address: '0x2e6B1d146064613E8f521Eb3c6e65070af964EbB',

0 commit comments

Comments
 (0)