Skip to content

Commit

Permalink
Merge pull request #3204 from dusk-network/feature-3203
Browse files Browse the repository at this point in the history
web-wallet: Prepare Migration for release
  • Loading branch information
nortonandreev authored Dec 17, 2024
2 parents 8c8b269 + 07c6cdd commit dd8c08b
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 16 deletions.
1 change: 0 additions & 1 deletion web-wallet/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ VITE_GAS_LIMIT_LOWER=10000000
VITE_GAS_LIMIT_UPPER=1000000000
VITE_GAS_PRICE_DEFAULT=1
VITE_GAS_PRICE_LOWER=1
VITE_MIGRATE_CONTRACT=""
VITE_MODE_MAINTENANCE=false
VITE_NODE_URL="" # connect to a specific node
```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
Textbox,
} from "$lib/dusk/components";
import { logo } from "$lib/dusk/icons";
import { settingsStore } from "$lib/stores";
import { settingsStore, walletStore } from "$lib/stores";
import {
account,
modal,
Expand Down Expand Up @@ -92,6 +92,9 @@
/** @type {boolean} */
let isInputDisabled = false;
$: ({ currentProfile } = $walletStore);
$: moonlightAccount = currentProfile?.account.toString();
$: walletState = {
address: $account?.address,
chainId: $account?.chainId,
Expand Down Expand Up @@ -163,7 +166,7 @@
}
return await getBalanceOfCoin(
walletAccount.address,
tokens[network][selectedChain].contract
tokens[network][selectedChain].tokenContract
);
} catch (err) {
return 0n;
Expand Down Expand Up @@ -338,14 +341,14 @@
isInputDisabled = false;
}}
amount={parseUnits(amount.replace(",", "."), ercDecimals)}
chainContract={tokens[network][selectedChain].contract}
chainContract={tokens[network][selectedChain].tokenContract}
migrationContract={tokens[network][selectedChain].migrationContract}
/>
{:else if migrationStep === 1}
<ExecuteMigration
on:incrementStep={() => migrationStep++}
amount={parseUnits(amount.replace(",", "."), ercDecimals)}
currentAddress={walletState.address ?? ""}
currentAddress={moonlightAccount ?? ""}
migrationContract={tokens[network][selectedChain].migrationContract}
/>
{:else}
Expand Down
18 changes: 8 additions & 10 deletions web-wallet/src/lib/containers/MigrateContract/tokenConfig.js
Original file line number Diff line number Diff line change
@@ -1,35 +1,33 @@
import { bsc, mainnet, sepolia } from "viem/chains";

const mainnetMigrateContract = import.meta.env.VITE_MIGRATE_CONTRACT;

/** @type {Tokens} */
export const tokens = {
mainnet: {
"BEP-20": {
chainId: bsc.id,
contract: "0xb2bd0749dbe21f623d9baba856d3b0f0e1bfec9c",
migrationContract: mainnetMigrateContract,
migrationContract: "0x9f5d1c067710fc6ed49a6444afd69b64799a57b6",
name: "BEP-20",
tokenContract: "0xb2bd0749dbe21f623d9baba856d3b0f0e1bfec9c",
},
"ERC-20": {
chainId: mainnet.id,
contract: "0x940a2db1b7008b6c776d4faaca729d6d4a4aa551",
migrationContract: mainnetMigrateContract,
migrationContract: "0x9f5d1c067710fc6ed49a6444afd69b64799a57b6",
name: "ERC-20",
tokenContract: "0x940a2db1b7008b6c776d4faaca729d6d4a4aa551",
},
},
testnet: {
"BEP-20": {
chainId: sepolia.id,
contract: "0xC416f5d2AE6BAec2a23f412Df11166afC35CAba2",
migrationContract: "0x9f5d1c067710fc6ed49a6444afd69b64799a57b6",
migrationContract: "0x1Bb81fbd735854Ed901aD7Aa1f5F72F64E5841Fc",
name: "BEP-20",
tokenContract: "0xC416f5d2AE6BAec2a23f412Df11166afC35CAba2",
},
"ERC-20": {
chainId: sepolia.id,
contract: "0x92DA9BE2039E818bB78223A6BA7C85CC2b17D8D5",
migrationContract: "0x63fd2B12034e108BCe73e8832b7dabC8bd67f738",
migrationContract: "0x81F15Ed1D87A6C840E410D7740D581e36c661640",
name: "ERC-20",
tokenContract: "0x92DA9BE2039E818bB78223A6BA7C85CC2b17D8D5",
},
},
};
2 changes: 1 addition & 1 deletion web-wallet/src/lib/containers/MigrateContract/tokens.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ type HexString = `0x${string}`;

type TokenInfo = {
chainId: number;
contract: HexString;
tokenContract: HexString;
migrationContract: HexString;
name: TokenNames;
};
Expand Down

0 comments on commit dd8c08b

Please sign in to comment.