tx · 6LXguuSvnAfubUNFFWoxAc55QXzaPM8S6S1YPo4krp86

3NCv9hyL5NUbMMkTXYnN9hL9AMQd6f2eVww:  -0.01400000 Waves

2020.10.06 15:39 [1208712] smart account 3NCv9hyL5NUbMMkTXYnN9hL9AMQd6f2eVww > SELF 0.00000000 Waves

{ "type": 13, "id": "6LXguuSvnAfubUNFFWoxAc55QXzaPM8S6S1YPo4krp86", "fee": 1400000, "feeAssetId": null, "timestamp": 1601988011857, "version": 2, "chainId": 84, "sender": "3NCv9hyL5NUbMMkTXYnN9hL9AMQd6f2eVww", "senderPublicKey": "CNQtsB6HAGUVvb5L3NshmGW2pD94ysV6dzV6Zcf6BFCq", "proofs": [ "2xihndPNQ4UmMYp562tEabUqLF2ZniQsyGqNUvYc2uNzpwiNbDQUyqiN8CChWKhH43uM2c6eT9i4RKhX4AjXNcz3" ], "script": "base64:AAIDAAAAAAAAAAQIARIAAAAAAAAAAAEAAAABaQEAAAAHZGVwb3NpdAAAAAAEAAAAA3BtdAkBAAAAB2V4dHJhY3QAAAABCAUAAAABaQAAAAdwYXltZW50BAAAAANsYmgIBQAAAAlsYXN0QmxvY2sAAAAGaGVpZ2h0AwkBAAAACWlzRGVmaW5lZAAAAAEIBQAAAANwbXQAAAAHYXNzZXRJZAkAAAIAAAABAgAAACFjYW4gaG9kbCB3YXZlcyBvbmx5IGF0IHRoZSBtb21lbnQEAAAACmN1cnJlbnRLZXkJAAJYAAAAAQgIBQAAAAFpAAAABmNhbGxlcgAAAAVieXRlcwQAAAANY3VycmVudEFtb3VudAQAAAAHJG1hdGNoMAkABBoAAAACBQAAAAR0aGlzBQAAAApjdXJyZW50S2V5AwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAAANJbnQEAAAAAWEFAAAAByRtYXRjaDAFAAAAAWEAAAAAAAAAAAAJAQAAAAhXcml0ZVNldAAAAAEJAARMAAAAAgkBAAAACURhdGFFbnRyeQAAAAIFAAAACmN1cnJlbnRLZXkJAAEsAAAAAgkAASwAAAACCQABLAAAAAIJAAEsAAAAAgkAASwAAAACCQABLAAAAAIJAAEsAAAAAgkAASwAAAACCQABLAAAAAIJAAGkAAAAAQUAAAANY3VycmVudEFtb3VudAIAAAABLAkAAaQAAAABCAUAAAADcG10AAAABmFtb3VudAIAAAABLAkAAaQAAAABCQAAaAAAAAIJAABpAAAAAggFAAAAA3BtdAAAAAZhbW91bnQAAAAAAAAAAGQAAAAAAAAAAHgCAAAAASwJAAGkAAAAAQkAAGkAAAACCQAAaAAAAAIJAABpAAAAAggFAAAAA3BtdAAAAAZhbW91bnQAAAAAAAAAAGQAAAAAAAAAAHgAAAAAAAAAABICAAAAAywwLAkAAaQAAAABBQAAAANsYmgCAAAAAywxMAUAAAADbmlsAAAAAJzsSQs=", "height": 1208712, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: HNWDWgwWaVDkgwDphahtMawG5TdBaC7wYdbVJf5TBh4B Next: 431NQGi4fRG5G7GQEsSAuRnkvADkg8Eae6PZRseSVr3K Diff:
OldNewDifferences
66 @Callable(i)
77 func deposit () = {
88 let pmt = extract(i.payment)
9- let ttxx = lastBlock.height
9+ let lbh = lastBlock.height
1010 if (isDefined(pmt.assetId))
1111 then throw("can hodl waves only at the moment")
1212 else {
1717 case _ =>
1818 0
1919 }
20- let newAmount = (currentAmount + pmt.amount)
21- if ((newAmount == pmt.amount))
22- then {
23- let oldAmount = split(toString(currentAmount), ",")
24- WriteSet([DataEntry(currentKey, (((((((oldAmount[0] + ",") + toString(((newAmount / 100) * 120))) + ",") + toString((((newAmount / 100) * 120) / 18))) + ",0,") + toString(ttxx)) + ",11"))])
25- }
26- else WriteSet([DataEntry(currentKey, (((((((toString(pmt.amount) + ",") + toString(((pmt.amount / 100) * 120))) + ",") + toString((((pmt.amount / 100) * 120) / 18))) + ",0,") + toString(ttxx)) + ",10"))])
20+ WriteSet([DataEntry(currentKey, (((((((((toString(currentAmount) + ",") + toString(pmt.amount)) + ",") + toString(((pmt.amount / 100) * 120))) + ",") + toString((((pmt.amount / 100) * 120) / 18))) + ",0,") + toString(lbh)) + ",10"))])
2721 }
28- }
29-
30-
31-
32-@Callable(i)
33-func withdraw (amount) = {
34- let currentKey = toBase58String(i.caller.bytes)
35- let currentAmount = match getInteger(this, currentKey) {
36- case a: Int =>
37- a
38- case _ =>
39- 0
40- }
41- let newAmount = (currentAmount - amount)
42- if ((0 > amount))
43- then throw("Can't withdraw negative amount")
44- else if ((0 > newAmount))
45- then throw("Not enough balance")
46- else ScriptResult(WriteSet([DataEntry(currentKey, newAmount)]), TransferSet([ScriptTransfer(i.caller, amount, unit)]))
4722 }
4823
4924
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 3 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44
55
66 @Callable(i)
77 func deposit () = {
88 let pmt = extract(i.payment)
9- let ttxx = lastBlock.height
9+ let lbh = lastBlock.height
1010 if (isDefined(pmt.assetId))
1111 then throw("can hodl waves only at the moment")
1212 else {
1313 let currentKey = toBase58String(i.caller.bytes)
1414 let currentAmount = match getInteger(this, currentKey) {
1515 case a: Int =>
1616 a
1717 case _ =>
1818 0
1919 }
20- let newAmount = (currentAmount + pmt.amount)
21- if ((newAmount == pmt.amount))
22- then {
23- let oldAmount = split(toString(currentAmount), ",")
24- WriteSet([DataEntry(currentKey, (((((((oldAmount[0] + ",") + toString(((newAmount / 100) * 120))) + ",") + toString((((newAmount / 100) * 120) / 18))) + ",0,") + toString(ttxx)) + ",11"))])
25- }
26- else WriteSet([DataEntry(currentKey, (((((((toString(pmt.amount) + ",") + toString(((pmt.amount / 100) * 120))) + ",") + toString((((pmt.amount / 100) * 120) / 18))) + ",0,") + toString(ttxx)) + ",10"))])
20+ WriteSet([DataEntry(currentKey, (((((((((toString(currentAmount) + ",") + toString(pmt.amount)) + ",") + toString(((pmt.amount / 100) * 120))) + ",") + toString((((pmt.amount / 100) * 120) / 18))) + ",0,") + toString(lbh)) + ",10"))])
2721 }
28- }
29-
30-
31-
32-@Callable(i)
33-func withdraw (amount) = {
34- let currentKey = toBase58String(i.caller.bytes)
35- let currentAmount = match getInteger(this, currentKey) {
36- case a: Int =>
37- a
38- case _ =>
39- 0
40- }
41- let newAmount = (currentAmount - amount)
42- if ((0 > amount))
43- then throw("Can't withdraw negative amount")
44- else if ((0 > newAmount))
45- then throw("Not enough balance")
46- else ScriptResult(WriteSet([DataEntry(currentKey, newAmount)]), TransferSet([ScriptTransfer(i.caller, amount, unit)]))
4722 }
4823
4924

github/deemru/w8io/873ac7e 
31.99 ms