Skip to content

Commit 89fe8d6

Browse files
feat(frontend): replace the ATA address with the main Solana address in the receive modal (#5176)
# Motivation The PRODSEC review suggested that we show the ATA address to the user for the specific token when needed, for example, when opening the receive modal. However, we are going to revisit how to show this information further on. For the current release we temporarily remove it. --------- Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
1 parent 7ee839f commit 89fe8d6

File tree

1 file changed

+3
-20
lines changed

1 file changed

+3
-20
lines changed

src/frontend/src/sol/components/receive/SolReceive.svelte

+3-20
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
<script lang="ts">
2-
import { isNullish, nonNullish } from '@dfinity/utils';
3-
import { address as solAddress } from '@solana/web3.js';
4-
import { findAssociatedTokenPda } from '@solana-program/token';
2+
import { isNullish } from '@dfinity/utils';
53
import ReceiveButtonWithModal from '$lib/components/receive/ReceiveButtonWithModal.svelte';
64
import ReceiveModal from '$lib/components/receive/ReceiveModal.svelte';
75
import { modalSolReceive } from '$lib/derived/modal.derived';
@@ -23,7 +21,6 @@
2321
isNetworkIdSOLLocal,
2422
isNetworkIdSOLTestnet
2523
} from '$lib/utils/network.utils';
26-
import { isTokenSpl } from '$sol/utils/spl.utils';
2724
2825
export let token: Token;
2926
@@ -39,23 +36,9 @@
3936
4037
const isDisabled = (): boolean => isNullish(addressData) || !addressData.certified;
4138
42-
let ataAddress: SolAddress | undefined;
43-
44-
const updateAtaAddress = async () => {
45-
[ataAddress] =
46-
nonNullish(addressData) && isTokenSpl(token)
47-
? await findAssociatedTokenPda({
48-
owner: solAddress(addressData.data),
49-
tokenProgram: solAddress(token.owner),
50-
mint: solAddress(token.address)
51-
})
52-
: [undefined];
53-
};
54-
55-
$: token, updateAtaAddress();
56-
39+
// TODO: PRODSEC: provide the ATA address too in the receive modal for SPL tokens
5740
let address: SolAddress | undefined;
58-
$: address = nonNullish(ataAddress) ? ataAddress : addressData?.data;
41+
$: address = addressData?.data;
5942
6043
const openReceive = async (modalId: symbol) => {
6144
if (isDisabled()) {

0 commit comments

Comments
 (0)