Repository: dusk-network/rusk (language: rust)

Issue:
web-wallet: Prepare Migration for release
### Tasks:

- Fix a bug where the destination address is set to the connected wallet's address, rather than the Wallet's Moonlight address https://github.com/dusk-network/rusk/blob/2a28aa711bd1b6385b87abcfee9fb3eed0491f89/web-wallet/src/lib/containers/MigrateContract/MigrateContract.svelte#L348
- Rename TokenInfo's `contract` to `tokenContract` for clarity
- Update `tokenConfig.js` with the Mainnet and Testnet contract details for both BEP-20 and ERC-20.


Discussion / hints:

Fix patch:
diff --git a/web-wallet/README.md b/web-wallet/README.md
index 117137c3e9..0fa42764c1 100644
--- a/web-wallet/README.md
+++ b/web-wallet/README.md
@@ -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
 ```
diff --git a/web-wallet/src/lib/containers/MigrateContract/MigrateContract.svelte b/web-wallet/src/lib/containers/MigrateContract/MigrateContract.svelte
index b5c0c8d02d..ae969c3f09 100644
--- a/web-wallet/src/lib/containers/MigrateContract/MigrateContract.svelte
+++ b/web-wallet/src/lib/containers/MigrateContract/MigrateContract.svelte
@@ -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,
@@ -92,6 +92,9 @@
   /** @type {boolean} */
   let isInputDisabled = false;
 
+  $: ({ currentProfile } = $walletStore);
+  $: moonlightAccount = currentProfile?.account.toString();
+
   $: walletState = {
     address: $account?.address,
     chainId: $account?.chainId,
@@ -163,7 +166,7 @@
       }
       return await getBalanceOfCoin(
         walletAccount.address,
-        tokens[network][selectedChain].contract
+        tokens[network][selectedChain].tokenContract
       );
     } catch (err) {
       return 0n;
@@ -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}
diff --git a/web-wallet/src/lib/containers/MigrateContract/tokenConfig.js b/web-wallet/src/lib/containers/MigrateContract/tokenConfig.js
index 1e62f713d2..546284d1cb 100644
--- a/web-wallet/src/lib/containers/MigrateContract/tokenConfig.js
+++ b/web-wallet/src/lib/containers/MigrateContract/tokenConfig.js
@@ -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",
     },
   },
 };
diff --git a/web-wallet/src/lib/containers/MigrateContract/tokens.d.ts b/web-wallet/src/lib/containers/MigrateContract/tokens.d.ts
index 43cd5ad808..ac1995507a 100644
--- a/web-wallet/src/lib/containers/MigrateContract/tokens.d.ts
+++ b/web-wallet/src/lib/containers/MigrateContract/tokens.d.ts
@@ -2,7 +2,7 @@ type HexString = `0x${string}`;
 
 type TokenInfo = {
   chainId: number;
-  contract: HexString;
+  tokenContract: HexString;
   migrationContract: HexString;
   name: TokenNames;
 };


Test patch: