tx · DvYHYVpHeX1gHeamQiL5paGJis8CjZGVCVHQuiEAwjUY
3NCv9hyL5NUbMMkTXYnN9hL9AMQd6f2eVww: -0.01400000 Waves
2020.10.04 22:34 [1206259] smart account 3NCv9hyL5NUbMMkTXYnN9hL9AMQd6f2eVww > SELF 0.00000000 Waves
{
"type": 13,
"id": "DvYHYVpHeX1gHeamQiL5paGJis8CjZGVCVHQuiEAwjUY",
"fee": 1400000,
"feeAssetId": null,
"timestamp": 1601840054292,
"version": 2,
"chainId": 84,
"sender": "3NCv9hyL5NUbMMkTXYnN9hL9AMQd6f2eVww",
"senderPublicKey": "CNQtsB6HAGUVvb5L3NshmGW2pD94ysV6dzV6Zcf6BFCq",
"proofs": [
"2qmYLKxkuDwnx64tyG8E3TtVciM6ZJ26RSPyBVYcxRPpHCVCYVtDuYks9pY6k2nqaWHMMecaHdqZPzXvuxqCYFN6"
],
"script": "base64:AAIDAAAAAAAAAAkIARIAEgMKAQEAAAAAAAAAAgAAAAFpAQAAAAdkZXBvc2l0AAAAAAQAAAADcG10CQEAAAAHZXh0cmFjdAAAAAEIBQAAAAFpAAAAB3BheW1lbnQEAAAAA3R0eAkAAlgAAAABCAUAAAABaQAAAA10cmFuc2FjdGlvbklkBAAAAAR0dHh4CAUAAAAJbGFzdEJsb2NrAAAABmhlaWdodAMJAQAAAAlpc0RlZmluZWQAAAABCAUAAAADcG10AAAAB2Fzc2V0SWQJAAACAAAAAQIAAAAhY2FuIGhvZGwgd2F2ZXMgb25seSBhdCB0aGUgbW9tZW50BAAAAApjdXJyZW50S2V5CQACWAAAAAEICAUAAAABaQAAAAZjYWxsZXIAAAAFYnl0ZXMEAAAADWN1cnJlbnRBbW91bnQEAAAAByRtYXRjaDAJAAQaAAAAAgUAAAAEdGhpcwUAAAAKY3VycmVudEtleQMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAADSW50BAAAAAFhBQAAAAckbWF0Y2gwBQAAAAFhAAAAAAAAAAAABAAAAAluZXdBbW91bnQJA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ationStatus": "succeeded",
"spentComplexity": 0
}
View: original | compacted
Prev: BZqo86oFkdD4iJ1ei4hsb9RrebrzZaszWrfV58c5Qk1x
Next: H8bp1c5cPx5EBbswp63kfDuhuqm34wnNjeYTThuBAyL8
Diff:
Old | New | | Differences |
---|
7 | 7 | | func deposit () = { |
---|
8 | 8 | | let pmt = extract(i.payment) |
---|
9 | 9 | | let ttx = toBase58String(i.transactionId) |
---|
| 10 | + | let ttxx = lastBlock.height |
---|
10 | 11 | | if (isDefined(pmt.assetId)) |
---|
11 | 12 | | then throw("can hodl waves only at the moment") |
---|
12 | 13 | | else { |
---|
|
18 | 19 | | 0 |
---|
19 | 20 | | } |
---|
20 | 21 | | let newAmount = (currentAmount + pmt.amount) |
---|
21 | | - | WriteSet([DataEntry(currentKey, ((toString(newAmount) + ",") + ttx))]) |
---|
| 22 | + | WriteSet([DataEntry(currentKey, ((((toString(newAmount) + ",") + ttx) + ",") + toString(ttxx)))]) |
---|
22 | 23 | | } |
---|
23 | 24 | | } |
---|
24 | 25 | | |
---|
Full:
Old | New | | Differences |
---|
1 | 1 | | {-# STDLIB_VERSION 3 #-} |
---|
2 | 2 | | {-# SCRIPT_TYPE ACCOUNT #-} |
---|
3 | 3 | | {-# CONTENT_TYPE DAPP #-} |
---|
4 | 4 | | |
---|
5 | 5 | | |
---|
6 | 6 | | @Callable(i) |
---|
7 | 7 | | func deposit () = { |
---|
8 | 8 | | let pmt = extract(i.payment) |
---|
9 | 9 | | let ttx = toBase58String(i.transactionId) |
---|
| 10 | + | let ttxx = lastBlock.height |
---|
10 | 11 | | if (isDefined(pmt.assetId)) |
---|
11 | 12 | | then throw("can hodl waves only at the moment") |
---|
12 | 13 | | else { |
---|
13 | 14 | | let currentKey = toBase58String(i.caller.bytes) |
---|
14 | 15 | | let currentAmount = match getInteger(this, currentKey) { |
---|
15 | 16 | | case a: Int => |
---|
16 | 17 | | a |
---|
17 | 18 | | case _ => |
---|
18 | 19 | | 0 |
---|
19 | 20 | | } |
---|
20 | 21 | | let newAmount = (currentAmount + pmt.amount) |
---|
21 | | - | WriteSet([DataEntry(currentKey, ((toString(newAmount) + ",") + ttx))]) |
---|
| 22 | + | WriteSet([DataEntry(currentKey, ((((toString(newAmount) + ",") + ttx) + ",") + toString(ttxx)))]) |
---|
22 | 23 | | } |
---|
23 | 24 | | } |
---|
24 | 25 | | |
---|
25 | 26 | | |
---|
26 | 27 | | |
---|
27 | 28 | | @Callable(i) |
---|
28 | 29 | | func withdraw (amount) = { |
---|
29 | 30 | | let currentKey = toBase58String(i.caller.bytes) |
---|
30 | 31 | | let currentAmount = match getInteger(this, currentKey) { |
---|
31 | 32 | | case a: Int => |
---|
32 | 33 | | a |
---|
33 | 34 | | case _ => |
---|
34 | 35 | | 0 |
---|
35 | 36 | | } |
---|
36 | 37 | | let newAmount = (currentAmount - amount) |
---|
37 | 38 | | if ((0 > amount)) |
---|
38 | 39 | | then throw("Can't withdraw negative amount") |
---|
39 | 40 | | else if ((0 > newAmount)) |
---|
40 | 41 | | then throw("Not enough balance") |
---|
41 | 42 | | else ScriptResult(WriteSet([DataEntry(currentKey, newAmount)]), TransferSet([ScriptTransfer(i.caller, amount, unit)])) |
---|
42 | 43 | | } |
---|
43 | 44 | | |
---|
44 | 45 | | |
---|