tx · 67P6n8R2shTenkFd1qSmTmPCAVC777PwRDd6DfnyqBrb

3N992tjd7EWM6dSHrdVjjjuJrLD4koNztZ9:  -0.01000000 Waves

2021.12.21 12:10 [1843828] smart account 3N992tjd7EWM6dSHrdVjjjuJrLD4koNztZ9 > SELF 0.00000000 Waves

{ "type": 13, "id": "67P6n8R2shTenkFd1qSmTmPCAVC777PwRDd6DfnyqBrb", "fee": 1000000, "feeAssetId": null, "timestamp": 1640077884989, "version": 2, "chainId": 84, "sender": "3N992tjd7EWM6dSHrdVjjjuJrLD4koNztZ9", "senderPublicKey": "uvA9vj4MSzAjnVrqWShC8bnbSu5CxvEbd1m68b21qEw", "proofs": [ "5NQi551bdeygC5e5KPZh5JypyUpXZob7CjSa98y7JovQ8iQyUVimLq1Dv6HbwzEyQALbBKQNSAv9hooaKVJQNorP" ], "script": "base64:AAIDAAAAAAAAAIkIARIAEgMKAQEaBgoBYRIBaRoICgFiEgNwbXQaDwoBYxIKY3VycmVudEtleRoSCgFkEg1jdXJyZW50QW1vdW50GgwKAWUSByRtYXRjaDAaBgoBZhIBYRoOCgFnEgluZXdBbW91bnQaCwoBaBIGYW1vdW50GgcKAWkSAnR4GgsKAWoSBnZlcmlmeQAAAAAAAAACAAAAAWEBAAAAB2RlcG9zaXQAAAAABAAAAAFiCQEAAAAHZXh0cmFjdAAAAAEIBQAAAAFhAAAAB3BheW1lbnQDCQEAAAAJaXNEZWZpbmVkAAAAAQgFAAAAAWIAAAAHYXNzZXRJZAkAAAIAAAABAgAAACFjYW4gaG9kbCB3YXZlcyBvbmx5IGF0IHRoZSBtb21lbnQEAAAAAWMJAAJYAAAAAQgIBQAAAAFhAAAABmNhbGxlcgAAAAVieXRlcwQAAAABZAQAAAABZQkABBoAAAACBQAAAAR0aGlzBQAAAAFjAwkAAAEAAAACBQAAAAFlAgAAAANJbnQEAAAAAWYFAAAAAWUFAAAAAWYAAAAAAAAAAAAEAAAAAWcJAABkAAAAAgUAAAABZAgFAAAAAWIAAAAGYW1vdW50CQEAAAAIV3JpdGVTZXQAAAABCQAETAAAAAIJAQAAAAlEYXRhRW50cnkAAAACBQAAAAFjBQAAAAFnBQAAAANuaWwAAAABYQEAAAAId2l0aGRyYXcAAAABAAAAAWgEAAAAAWMJAAJYAAAAAQgIBQAAAAFhAAAABmNhbGxlcgAAAAVieXRlcwQAAAABZAQAAAABZQkABBoAAAACBQAAAAR0aGlzBQAAAAFjAwkAAAEAAAACBQAAAAFlAgAAAANJbnQEAAAAAWYFAAAAAWUFAAAAAWYAAAAAAAAAAAAEAAAAAWcJAABlAAAAAgUAAAABZAUAAAABaAMJAABmAAAAAgAAAAAAAAAAAAUAAAABaAkAAAIAAAABAgAAAB5DYW4ndCB3aXRoZHJhdyBuZWdhdGl2ZSBhbW91bnQDCQAAZgAAAAIAAAAAAAAAAAAFAAAAAWcJAAACAAAAAQIAAAASTm90IGVub3VnaCBiYWxhbmNlCQEAAAAMU2NyaXB0UmVzdWx0AAAAAgkBAAAACFdyaXRlU2V0AAAAAQkABEwAAAACCQEAAAAJRGF0YUVudHJ5AAAAAgUAAAABYwUAAAABZwUAAAADbmlsCQEAAAALVHJhbnNmZXJTZXQAAAABCQAETAAAAAIJAQAAAA5TY3JpcHRUcmFuc2ZlcgAAAAMIBQAAAAFhAAAABmNhbGxlcgUAAAABaAUAAAAEdW5pdAUAAAADbmlsAAAAAQAAAAFpAQAAAAFqAAAAAAkAAfQAAAADCAUAAAABaQAAAAlib2R5Qnl0ZXMJAAGRAAAAAggFAAAAAWkAAAAGcHJvb2ZzAAAAAAAAAAAACAUAAAABaQAAAA9zZW5kZXJQdWJsaWNLZXlJ+KQM", "height": 1843828, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: none Next: Uczu9NeLi66th3msbJ26ioEekmijg3PGBbJzZNjTEMp Full:
OldNewDifferences
1-# no script
1+{-# STDLIB_VERSION 3 #-}
2+{-# SCRIPT_TYPE ACCOUNT #-}
3+{-# CONTENT_TYPE DAPP #-}
4+
5+
6+@Callable(i)
7+func deposit () = {
8+ let pmt = extract(i.payment)
9+ if (isDefined(pmt.assetId))
10+ then throw("can hodl waves only at the moment")
11+ else {
12+ let currentKey = toBase58String(i.caller.bytes)
13+ let currentAmount = match getInteger(this, currentKey) {
14+ case a: Int =>
15+ a
16+ case _ =>
17+ 0
18+ }
19+ let newAmount = (currentAmount + pmt.amount)
20+ WriteSet([DataEntry(currentKey, newAmount)])
21+ }
22+ }
23+
24+
25+
26+@Callable(i)
27+func withdraw (amount) = {
28+ let currentKey = toBase58String(i.caller.bytes)
29+ let currentAmount = match getInteger(this, currentKey) {
30+ case a: Int =>
31+ a
32+ case _ =>
33+ 0
34+ }
35+ let newAmount = (currentAmount - amount)
36+ if ((0 > amount))
37+ then throw("Can't withdraw negative amount")
38+ else if ((0 > newAmount))
39+ then throw("Not enough balance")
40+ else ScriptResult(WriteSet([DataEntry(currentKey, newAmount)]), TransferSet([ScriptTransfer(i.caller, amount, unit)]))
41+ }
42+
43+
44+@Verifier(tx)
45+func verify () = sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey)
46+

github/deemru/w8io/026f985 
13.51 ms