From 2cb7a0a0e619064ea13d2d748daf817b346051bd Mon Sep 17 00:00:00 2001 From: Kurdistan Tech Ministry Date: Sat, 17 Jan 2026 04:07:14 +0300 Subject: [PATCH] Fix TaxZekatScreen: use pezTreasury.governmentPotAccountId for transfers --- mobile/src/screens/TaxZekatScreen.tsx | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/mobile/src/screens/TaxZekatScreen.tsx b/mobile/src/screens/TaxZekatScreen.tsx index 28fed1b7..99725540 100644 --- a/mobile/src/screens/TaxZekatScreen.tsx +++ b/mobile/src/screens/TaxZekatScreen.tsx @@ -125,15 +125,12 @@ const TaxZekatScreen: React.FC = () => { const amountInUnits = BigInt(Math.floor(parseFloat(amount) * 1e12)); // Convert to smallest unit (12 decimals for HEZ) - // Get treasury account address - // Treasury account is derived from pallet ID "py/trsry" (standard Substrate treasury) - const treasuryAccount = api.consts.treasury?.palletId - ? api.registry.createType('AccountId', api.consts.treasury.palletId.toU8a()) - : null; - - if (!treasuryAccount) { - throw new Error('Treasury account not found'); + // Get government pot account from PezTreasury pallet + const treasuryAccountOption = await api.query.pezTreasury.governmentPotAccountId(); + if (!treasuryAccountOption || treasuryAccountOption.isEmpty) { + throw new Error('Government treasury account not found'); } + const treasuryAccount = treasuryAccountOption.toString(); if (__DEV__) { console.log('[TaxZekat] Treasury account:', treasuryAccount.toString());