From f734835e7200d7b69cb5a3c8c048dc7f4c982eba Mon Sep 17 00:00:00 2001 From: "ALGO Tables (Jeff S.)" <105945985+algotables@users.noreply.github.com> Date: Fri, 10 May 2024 04:07:32 +0000 Subject: [PATCH] Fix type mismatches in PersonalVault smart contract - Updated `ptxn.receiver` comparison to use `Global.current_application_address` instead of `Global.current_application_id` to fix type mismatch. - Corrected `op.app_opted_in` function call to pass `Global.current_application_id` instead of `Global.current_application_address`. --- projects/challenge/smart_contracts/personal_vault/contract.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/projects/challenge/smart_contracts/personal_vault/contract.py b/projects/challenge/smart_contracts/personal_vault/contract.py index d1e6cf8..58d2333 100644 --- a/projects/challenge/smart_contracts/personal_vault/contract.py +++ b/projects/challenge/smart_contracts/personal_vault/contract.py @@ -23,11 +23,11 @@ def opt_in_to_app(self) -> None: def deposit(self, ptxn: gtxn.PaymentTransaction) -> UInt64: assert ptxn.amount > 0, "Deposit amount must be greater than 0" assert ( - ptxn.receiver == Global.current_application_id + ptxn.receiver == Global.current_application_address ), "Deposit receiver must be the contract address" assert ptxn.sender == Txn.sender, "Deposit sender must be the caller" assert op.app_opted_in( - Txn.sender, Global.current_application_address + Txn.sender, Global.current_application_id ), "Deposit sender must opt-in to the app first." self.balance[Txn.sender] += ptxn.amount