tx · Uczu9NeLi66th3msbJ26ioEekmijg3PGBbJzZNjTEMp

3N992tjd7EWM6dSHrdVjjjuJrLD4koNztZ9:  -0.01000000 Waves

2021.12.21 12:21 [1843837] smart account 3N992tjd7EWM6dSHrdVjjjuJrLD4koNztZ9 > SELF 0.00000000 Waves

{ "type": 13, "id": "Uczu9NeLi66th3msbJ26ioEekmijg3PGBbJzZNjTEMp", "fee": 1000000, "feeAssetId": null, "timestamp": 1640078523708, "version": 2, "chainId": 84, "sender": "3N992tjd7EWM6dSHrdVjjjuJrLD4koNztZ9", "senderPublicKey": "uvA9vj4MSzAjnVrqWShC8bnbSu5CxvEbd1m68b21qEw", "proofs": [ "5zMPowdq3dHe6rfwV4HAVi5Ab78r4PbmpuwbBtDQiyxTFugmsfremfYTRjVKS1KDJKP6WGzzrBvYGpPybC6tEviw" ], "script": "base64:AAIFAAAAAAAAADwIAhIAGgYKAWESAWkaCgoBYhIFYXNzZXQaDAoBYxIHYXNzZXRJZBoHCgFkEgJ0eBoLCgFlEgZ2ZXJpZnkAAAAAAAAAAQAAAAFhAQAAAARjYWxsAAAAAAQAAAABYgkABEMAAAAHAgAAAAVBc3NldAIAAAAAAAAAAAAAAAABAAAAAAAAAAAABgUAAAAEdW5pdAAAAAAAAAAAAAQAAAABYwkABDgAAAABBQAAAAFiCQAETAAAAAIJAQAAAAtCaW5hcnlFbnRyeQAAAAICAAAAA2JpbgEAAAAACQAETAAAAAIJAQAAAAxCb29sZWFuRW50cnkAAAACAgAAAARib29sBgkABEwAAAACCQEAAAAMSW50ZWdlckVudHJ5AAAAAgIAAAADaW50AAAAAAAAAAABCQAETAAAAAIJAQAAAAtTdHJpbmdFbnRyeQAAAAICAAAAA3N0cgIAAAAACQAETAAAAAIJAQAAAAtEZWxldGVFbnRyeQAAAAECAAAAA3N0cgkABEwAAAACBQAAAAFiCQAETAAAAAIJAQAAAA5TY3JpcHRUcmFuc2ZlcgAAAAMIBQAAAAFhAAAABmNhbGxlcgAAAAAAAAAAAQUAAAABYwUAAAADbmlsAAAAAQAAAAFkAQAAAAFlAAAAAAkAAfQAAAADCAUAAAABZAAAAAlib2R5Qnl0ZXMJAAGRAAAAAggFAAAAAWQAAAAGcHJvb2ZzAAAAAAAAAAAACAUAAAABZAAAAA9zZW5kZXJQdWJsaWNLZXmrVJkl", "height": 1843837, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 67P6n8R2shTenkFd1qSmTmPCAVC777PwRDd6DfnyqBrb Next: EH6NLGngLA8Aptjb15t9xGf3V3mzZWPhcNZfGKvVa5Y4 Diff:
OldNewDifferences
1-{-# STDLIB_VERSION 3 #-}
1+{-# STDLIB_VERSION 5 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44
55
66 @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)]))
7+func call () = {
8+ let asset = Issue("Asset", "", 1, 0, true, unit, 0)
9+ let assetId = calculateAssetId(asset)
10+[BinaryEntry("bin", base58''), BooleanEntry("bool", true), IntegerEntry("int", 1), StringEntry("str", ""), DeleteEntry("str"), asset, ScriptTransfer(i.caller, 1, assetId)]
4111 }
4212
4313
Full:
OldNewDifferences
1-{-# STDLIB_VERSION 3 #-}
1+{-# STDLIB_VERSION 5 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44
55
66 @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)]))
7+func call () = {
8+ let asset = Issue("Asset", "", 1, 0, true, unit, 0)
9+ let assetId = calculateAssetId(asset)
10+[BinaryEntry("bin", base58''), BooleanEntry("bool", true), IntegerEntry("int", 1), StringEntry("str", ""), DeleteEntry("str"), asset, ScriptTransfer(i.caller, 1, assetId)]
4111 }
4212
4313
4414 @Verifier(tx)
4515 func verify () = sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey)
4616

github/deemru/w8io/026f985 
23.64 ms