Skip to content

Commit f734835

Browse files
committed
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`.
1 parent 7eb8d0b commit f734835

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

  • projects/challenge/smart_contracts/personal_vault

projects/challenge/smart_contracts/personal_vault/contract.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,11 @@ def opt_in_to_app(self) -> None:
2323
def deposit(self, ptxn: gtxn.PaymentTransaction) -> UInt64:
2424
assert ptxn.amount > 0, "Deposit amount must be greater than 0"
2525
assert (
26-
ptxn.receiver == Global.current_application_id
26+
ptxn.receiver == Global.current_application_address
2727
), "Deposit receiver must be the contract address"
2828
assert ptxn.sender == Txn.sender, "Deposit sender must be the caller"
2929
assert op.app_opted_in(
30-
Txn.sender, Global.current_application_address
30+
Txn.sender, Global.current_application_id
3131
), "Deposit sender must opt-in to the app first."
3232

3333
self.balance[Txn.sender] += ptxn.amount

0 commit comments

Comments
 (0)