tx · 6TVz36gsY7NjWnmApEvePvHv5pYsc3dRBqRZTRW6xENq

3NCv9hyL5NUbMMkTXYnN9hL9AMQd6f2eVww:  -0.01400000 Waves

2020.10.04 23:28 [1206309] smart account 3NCv9hyL5NUbMMkTXYnN9hL9AMQd6f2eVww > SELF 0.00000000 Waves

{ "type": 13, "id": "6TVz36gsY7NjWnmApEvePvHv5pYsc3dRBqRZTRW6xENq", "fee": 1400000, "feeAssetId": null, "timestamp": 1601843379683, "version": 2, "chainId": 84, "sender": "3NCv9hyL5NUbMMkTXYnN9hL9AMQd6f2eVww", "senderPublicKey": "CNQtsB6HAGUVvb5L3NshmGW2pD94ysV6dzV6Zcf6BFCq", "proofs": [ "4vwHXgGWCd325cMpjmft3PtdikShe5SayKQ4S5Hpf41tEMj8ZxNMrJe6RWZWYMJjRQU7649aifgRpUwXQs4z4ubV" ], "script": "base64:AAIDAAAAAAAAAAkIARIAEgMKAQEAAAAAAAAAAgAAAAFpAQAAAAdkZXBvc2l0AAAAAAQAAAADcG10CQEAAAAHZXh0cmFjdAAAAAEIBQAAAAFpAAAAB3BheW1lbnQEAAAABHR0eHgIBQAAAAlsYXN0QmxvY2sAAAAGaGVpZ2h0AwkBAAAACWlzRGVmaW5lZAAAAAEIBQAAAANwbXQAAAAHYXNzZXRJZAkAAAIAAAABAgAAACFjYW4gaG9kbCB3YXZlcyBvbmx5IGF0IHRoZSBtb21lbnQEAAAACmN1cnJlbnRLZXkJAAJYAAAAAQgIBQAAAAFpAAAABmNhbGxlcgAAAAVieXRlcwQAAAANY3VycmVudEFtb3VudAQAAAAHJG1hdGNoMAkABBoAAAACBQAAAAR0aGlzBQAAAApjdXJyZW50S2V5AwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAAANJbnQEAAAAAWEFAAAAByRtYXRjaDAFAAAAAWEAAAAAAAAAAAADCQAAAAAAAAIFAAAADWN1cnJlbnRBbW91bnQAAAAAAAAAAAAJAQAAAAhXcml0ZVNldAAAAAEJAARMAAAAAgk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WJ5dGVzBAAAAA1jdXJyZW50QW1vdW50BAAAAAckbWF0Y2gwCQAEGgAAAAIFAAAABHRoaXMFAAAACmN1cnJlbnRLZXkDCQAAAQAAAAIFAAAAByRtYXRjaDACAAAAA0ludAQAAAABYQUAAAAHJG1hdGNoMAUAAAABYQAAAAAAAAAAAAQAAAAJbmV3QW1vdW50CQAAZQAAAAIFAAAADWN1cnJlbnRBbW91bnQFAAAABmFtb3VudAMJAABmAAAAAgAAAAAAAAAAAAUAAAAGYW1vdW50CQAAAgAAAAECAAAAHkNhbid0IHdpdGhkcmF3IG5lZ2F0aXZlIGFtb3VudAMJAABmAAAAAgAAAAAAAAAAAAUAAAAJbmV3QW1vdW50CQAAAgAAAAECAAAAEk5vdCBlbm91Z2ggYmFsYW5jZQkBAAAADFNjcmlwdFJlc3VsdAAAAAIJAQAAAAhXcml0ZVNldAAAAAEJAARMAAAAAgkBAAAACURhdGFFbnRyeQAAAAIFAAAACmN1cnJlbnRLZXkFAAAACW5ld0Ftb3VudAUAAAADbmlsCQEAAAALVHJhbnNmZXJTZXQAAAABCQAETAAAAAIJAQAAAA5TY3JpcHRUcmFuc2ZlcgAAAAMIBQAAAAFpAAAABmNhbGxlcgUAAAAGYW1vdW50BQAAAAR1bml0BQAAAANuaWwAAAAAxnew1Q==", "height": 1206309, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: GYSsdn3X8Tv85cvGck9nh3xti2qbaYvpDbXFwpYLpvBd Next: 6M1xCGMJ85Zx3VCDXdoqXk8bMF2ThaZHcf3E6DAV2eyp Diff:
OldNewDifferences
1717 case _ =>
1818 0
1919 }
20- let newAmount = (currentAmount + pmt.amount)
21- if ((currentAmount != 0))
22- then WriteSet([DataEntry(currentKey, (((((((toString((newAmount + pmt.amount)) + ",") + toString((((newAmount + pmt.amount) / 100) * 120))) + ",") + toString(((((newAmount + pmt.amount) / 100) * 120) / 18))) + ",0,") + toString(ttxx)) + ",10"))])
23- else WriteSet([DataEntry(currentKey, (((((((toString(newAmount) + ",") + toString(((newAmount / 100) * 120))) + ",") + toString((((newAmount / 100) * 120) / 18))) + ",0,") + toString(ttxx)) + ",10"))])
20+ if ((currentAmount == 0))
21+ then WriteSet([DataEntry(currentKey, (((((((toString(pmt.amount) + ",") + toString(((pmt.amount / 100) * 120))) + ",") + toString((((pmt.amount / 100) * 120) / 18))) + ",0,") + toString(ttxx)) + ",10"))])
22+ else {
23+ let oldAmount = split(toString(currentAmount), ",")
24+ let newAmount = (currentAmount + pmt.amount)
25+ WriteSet([DataEntry(currentKey, (((((((oldAmount[0] + ",") + toString(((newAmount / 100) * 120))) + ",") + toString((((newAmount / 100) * 120) / 18))) + ",0,") + toString(ttxx)) + ",11"))])
26+ }
2427 }
2528 }
2629
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)
99 let ttxx = 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 ((currentAmount != 0))
22- then WriteSet([DataEntry(currentKey, (((((((toString((newAmount + pmt.amount)) + ",") + toString((((newAmount + pmt.amount) / 100) * 120))) + ",") + toString(((((newAmount + pmt.amount) / 100) * 120) / 18))) + ",0,") + toString(ttxx)) + ",10"))])
23- else WriteSet([DataEntry(currentKey, (((((((toString(newAmount) + ",") + toString(((newAmount / 100) * 120))) + ",") + toString((((newAmount / 100) * 120) / 18))) + ",0,") + toString(ttxx)) + ",10"))])
20+ if ((currentAmount == 0))
21+ then WriteSet([DataEntry(currentKey, (((((((toString(pmt.amount) + ",") + toString(((pmt.amount / 100) * 120))) + ",") + toString((((pmt.amount / 100) * 120) / 18))) + ",0,") + toString(ttxx)) + ",10"))])
22+ else {
23+ let oldAmount = split(toString(currentAmount), ",")
24+ let newAmount = (currentAmount + pmt.amount)
25+ WriteSet([DataEntry(currentKey, (((((((oldAmount[0] + ",") + toString(((newAmount / 100) * 120))) + ",") + toString((((newAmount / 100) * 120) / 18))) + ",0,") + toString(ttxx)) + ",11"))])
26+ }
2427 }
2528 }
2629
2730
2831
2932 @Callable(i)
3033 func withdraw (amount) = {
3134 let currentKey = toBase58String(i.caller.bytes)
3235 let currentAmount = match getInteger(this, currentKey) {
3336 case a: Int =>
3437 a
3538 case _ =>
3639 0
3740 }
3841 let newAmount = (currentAmount - amount)
3942 if ((0 > amount))
4043 then throw("Can't withdraw negative amount")
4144 else if ((0 > newAmount))
4245 then throw("Not enough balance")
4346 else ScriptResult(WriteSet([DataEntry(currentKey, newAmount)]), TransferSet([ScriptTransfer(i.caller, amount, unit)]))
4447 }
4548
4649

github/deemru/w8io/169f3d6 
30.03 ms