Skip to content

Commit

Permalink
Merge pull request #224 from franklinsch/bank-deposit
Browse files Browse the repository at this point in the history
Add deposit function to bank
  • Loading branch information
franklinsch authored Jun 4, 2018
2 parents 50d6568 + 04fe574 commit 9ff2cbf
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions examples/valid/bank.flint
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,11 @@ Bank :: account <- (accounts) {
// Emit the Ethereum event.
didCompleteTransfer(account, destination, amount)
}

@payable
public mutating func deposit(implicit value: Wei) {
balances[account].transfer(&value)
}

public mutating func withdraw(amount: Int) {
// Transfer some Wei from balances[account] into a local variable.
Expand Down

0 comments on commit 9ff2cbf

Please sign in to comment.