tx · 4kgLm4Z8B3qDrdytaQSYq1e7KtpmWFaGGguBaUjxAWfJ

3N58U7hA1kzMTCUqHiJGdcPdjxAKspMgGNp:  -0.01000000 Waves

2021.07.16 17:03 [1616258] smart account 3N58U7hA1kzMTCUqHiJGdcPdjxAKspMgGNp > SELF 0.00000000 Waves

{ "type": 13, "id": "4kgLm4Z8B3qDrdytaQSYq1e7KtpmWFaGGguBaUjxAWfJ", "fee": 1000000, "feeAssetId": null, "timestamp": 1626444235612, "version": 2, "chainId": 84, "sender": "3N58U7hA1kzMTCUqHiJGdcPdjxAKspMgGNp", "senderPublicKey": "85gydchvWB9gMPFCKM6kfLPWFSATbtGog2Y6rUjhtQKT", "proofs": [ "2WoepbhTwjtmB44Pu7MMpehCWwuAHfXX73QDQmvWyvJLon3sJXoQoHF1RzX7FEERrWFZ9b77JoaVhcYkYSheGS3f" ], "script": "base64:AAIDAAAAAAAAAAQIARIAAAAAAAAAAAEAAAABaQEAAAAHZGVwb3NpdAAAAAAEAAAACXN3YXBUb2tlbgEAAAAgb43vwMVF3NniH29QbTemn52wAqbd0CJjn9c5H5QYbCgEAAAAA3BtdAkBAAAAB2V4dHJhY3QAAAABCAUAAAABaQAAAAdwYXltZW50AwkBAAAACWlzRGVmaW5lZAAAAAEIBQAAAANwbXQAAAAHYXNzZXRJZAkAAAIAAAABAgAAACFjYW4gaG9kbCB3YXZlcyBvbmx5IGF0IHRoZSBtb21lbnQEAAAABmFtb3VudAgFAAAAA3BtdAAAAAZhbW91bnQJAQAAAAtUcmFuc2ZlclNldAAAAAEJAARMAAAAAgkBAAAADlNjcmlwdFRyYW5zZmVyAAAAAwgFAAAAAWkAAAAGY2FsbGVyBQAAAAZhbW91bnQFAAAACXN3YXBUb2tlbgUAAAADbmlsAAAAAPQdAc8=", "height": 1616258, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 8bwq8FdCd7WLjzR7LavyAy8jvmsyZLq8jRBvQi9HGH9F Next: E5KdkibjJL43e5yndhL8a1D1H5DxjMtiwr9rYtthRyMF Diff:
OldNewDifferences
1010 if (isDefined(pmt.assetId))
1111 then throw("can hodl waves only at the moment")
1212 else {
13- let currentKey = toBase58String(i.caller.bytes)
14- let currentAmount = match getInteger(this, currentKey) {
15- case a: Int =>
16- a
17- case _ =>
18- 0
13+ let amount = pmt.amount
14+ TransferSet([ScriptTransfer(i.caller, amount, swapToken)])
1915 }
20- let newAmount = (currentAmount + pmt.amount)
21- TransferSet([ScriptTransfer(i.caller, newAmount, swapToken)])
22- }
23- }
24-
25-
26-
27-@Callable(i)
28-func withdraw (amount) = {
29- let swapToken = base58'3N58U7hA1kzMTCUqHiJGdcPdjxAKspMgGNp'
30- let currentKey = toBase58String(i.caller.bytes)
31- let currentAmount = match getInteger(this, currentKey) {
32- case a: Int =>
33- a
34- case _ =>
35- 0
36- }
37- let newAmount = (currentAmount - amount)
38- if ((0 > amount))
39- then throw("Can't withdraw negative amount")
40- else if ((0 > newAmount))
41- then throw("Not enough balance")
42- else ScriptResult(WriteSet([DataEntry(currentKey, newAmount)]), TransferSet([ScriptTransfer(i.caller, amount, swapToken)]))
4316 }
4417
4518
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 3 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44
55
66 @Callable(i)
77 func deposit () = {
88 let swapToken = base58'8WTnTr8QxFYKhMo7tkjLigfw2zAFFQYzjpoNdSFruTL3'
99 let pmt = extract(i.payment)
1010 if (isDefined(pmt.assetId))
1111 then throw("can hodl waves only at the moment")
1212 else {
13- let currentKey = toBase58String(i.caller.bytes)
14- let currentAmount = match getInteger(this, currentKey) {
15- case a: Int =>
16- a
17- case _ =>
18- 0
13+ let amount = pmt.amount
14+ TransferSet([ScriptTransfer(i.caller, amount, swapToken)])
1915 }
20- let newAmount = (currentAmount + pmt.amount)
21- TransferSet([ScriptTransfer(i.caller, newAmount, swapToken)])
22- }
23- }
24-
25-
26-
27-@Callable(i)
28-func withdraw (amount) = {
29- let swapToken = base58'3N58U7hA1kzMTCUqHiJGdcPdjxAKspMgGNp'
30- let currentKey = toBase58String(i.caller.bytes)
31- let currentAmount = match getInteger(this, currentKey) {
32- case a: Int =>
33- a
34- case _ =>
35- 0
36- }
37- let newAmount = (currentAmount - amount)
38- if ((0 > amount))
39- then throw("Can't withdraw negative amount")
40- else if ((0 > newAmount))
41- then throw("Not enough balance")
42- else ScriptResult(WriteSet([DataEntry(currentKey, newAmount)]), TransferSet([ScriptTransfer(i.caller, amount, swapToken)]))
4316 }
4417
4518

github/deemru/w8io/169f3d6 
25.77 ms