From 5af27695a90fa1036865c9145f27103b9a39d3e2 Mon Sep 17 00:00:00 2001 From: keerthilochankumar Date: Sun, 26 May 2024 00:44:23 +0530 Subject: [PATCH] python-challenge-1 solved --- .../challenge/smart_contracts/personal_vault/contract.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/projects/challenge/smart_contracts/personal_vault/contract.py b/projects/challenge/smart_contracts/personal_vault/contract.py index d1e6cf8..1ae6936 100644 --- a/projects/challenge/smart_contracts/personal_vault/contract.py +++ b/projects/challenge/smart_contracts/personal_vault/contract.py @@ -12,7 +12,7 @@ class PersonalVault(ARC4Contract): - def __init__(self) -> None: + def _init_(self) -> None: self.balance = LocalState(UInt64) @arc4.baremethod(allow_actions=["OptIn"]) @@ -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