contract Token;
let balances : address->u32;
def transfer (^ to: address, amount: i32) {
match {
case balances[sender] >= amount : {
balances[sender] -= amount;
balances[to] += amount;
}
case balances[sender] < amount : {
// stop the execution, revert the transaction
throw("Sender:", sender,
"does not have enough funds to satisfy the transaction.");
}
}
}