Mode:
Duration:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
module 0x1::Bank {
resource struct Account { balance: u64 }
public fun create(): Account {
Account { balance: 0 }
}
public fun deposit(acc: &mut Account, amount: u64) {
acc.balance = acc.balance + amount
}
public fun withdraw(acc: &mut Account, amount: u64) {
acc.balance = acc.balance - amount
}
}Coding works best on desktop or with an external keyboard.