From 396dea67a32b82351dbc15fbd5c41aebeda147e3 Mon Sep 17 00:00:00 2001 From: pharsha9 <116417608+pharsha9@users.noreply.github.com> Date: Mon, 6 May 2024 10:00:27 +0530 Subject: [PATCH] solved --- .../challenge/smart_contracts/personal_vault/contract.py | 5 +++-- 1 file changed, 3 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..72b00c7 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 @@ -47,3 +47,4 @@ def withdraw(self) -> UInt64: ).submit() return userBalance +