tx · 6M1xCGMJ85Zx3VCDXdoqXk8bMF2ThaZHcf3E6DAV2eyp

3NCv9hyL5NUbMMkTXYnN9hL9AMQd6f2eVww:  -0.01400000 Waves

2020.10.04 23:31 [1206311] smart account 3NCv9hyL5NUbMMkTXYnN9hL9AMQd6f2eVww > SELF 0.00000000 Waves

{ "type": 13, "id": "6M1xCGMJ85Zx3VCDXdoqXk8bMF2ThaZHcf3E6DAV2eyp", "fee": 1400000, "feeAssetId": null, "timestamp": 1601843512129, "version": 2, "chainId": 84, "sender": "3NCv9hyL5NUbMMkTXYnN9hL9AMQd6f2eVww", "senderPublicKey": "CNQtsB6HAGUVvb5L3NshmGW2pD94ysV6dzV6Zcf6BFCq", "proofs": [ "4Gf265iyfCxzLW7EccZKvozAc2fqb36h4uT7DKSfzJbveABZEnYYGYnCHX68JYgZvdjQMc9fJtZhMzpncVik7cBW" ], "script": "base64:AAIDAAAAAAAAAAkIARIAEgMKAQEAAAAAAAAAAgAAAAFpAQAAAAdkZXBvc2l0AAAAAAQAAAADcG10CQEAAAAHZXh0cmFjdAAAAAEIBQAAAAFpAAAAB3BheW1lbnQEAAAABHR0eHgIBQAAAAlsYXN0QmxvY2sAAAAGaGVpZ2h0AwkBAAAACWlzRGVmaW5lZAAAAAEIBQAAAANwbXQAAAAHYXNzZXRJZAkAAAIAAAABAgAAACFjYW4gaG9kbCB3YXZlcyBvbmx5IGF0IHRoZSBtb21lbnQEAAAACmN1cnJlbnRLZXkJAAJYAAAAAQgIBQAAAAFpAAAABmNhbGxlcgAAAAVieXRlcwQAAAANY3VycmVudEFtb3VudAQAAAAHJG1hdGNoMAkABBoAAAACBQAAAAR0aGlzBQAAAApjdXJyZW50S2V5AwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAAANJbnQEAAAAAWEFAAAAByRtYXRjaDAFAAAAAWEAAAAAAAAAAAADCQAAZgAAAAIFAAAADWN1cnJlbnRBbW91bnQAAAAAAAAAAAAEAAAACW9sZEFtb3VudAkABLUAAAACC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AAABWJ5dGVzBAAAAA1jdXJyZW50QW1vdW50BAAAAAckbWF0Y2gwCQAEGgAAAAIFAAAABHRoaXMFAAAACmN1cnJlbnRLZXkDCQAAAQAAAAIFAAAAByRtYXRjaDACAAAAA0ludAQAAAABYQUAAAAHJG1hdGNoMAUAAAABYQAAAAAAAAAAAAQAAAAJbmV3QW1vdW50CQAAZQAAAAIFAAAADWN1cnJlbnRBbW91bnQFAAAABmFtb3VudAMJAABmAAAAAgAAAAAAAAAAAAUAAAAGYW1vdW50CQAAAgAAAAECAAAAHkNhbid0IHdpdGhkcmF3IG5lZ2F0aXZlIGFtb3VudAMJAABmAAAAAgAAAAAAAAAAAAUAAAAJbmV3QW1vdW50CQAAAgAAAAECAAAAEk5vdCBlbm91Z2ggYmFsYW5jZQkBAAAADFNjcmlwdFJlc3VsdAAAAAIJAQAAAAhXcml0ZVNldAAAAAEJAARMAAAAAgkBAAAACURhdGFFbnRyeQAAAAIFAAAACmN1cnJlbnRLZXkFAAAACW5ld0Ftb3VudAUAAAADbmlsCQEAAAALVHJhbnNmZXJTZXQAAAABCQAETAAAAAIJAQAAAA5TY3JpcHRUcmFuc2ZlcgAAAAMIBQAAAAFpAAAABmNhbGxlcgUAAAAGYW1vdW50BQAAAAR1bml0BQAAAANuaWwAAAAA16HCSQ==", "height": 1206311, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 6TVz36gsY7NjWnmApEvePvHv5pYsc3dRBqRZTRW6xENq Next: HNWDWgwWaVDkgwDphahtMawG5TdBaC7wYdbVJf5TBh4B Diff:
OldNewDifferences
2020 }
2121 else 0
2222 }
23- if ((e == 0))
24- then WriteSet([DataEntry(d, (((((((toString(b.amount) + ",") + toString(((b.amount / 100) * 120))) + ",") + toString((((b.amount / 100) * 120) / 18))) + ",0,") + toString(c)) + ",10"))])
25- else {
23+ if ((e > 0))
24+ then {
2625 let h = split(toString(e), ",")
2726 let i = (e + b.amount)
2827 WriteSet([DataEntry(d, (((((((h[0] + ",") + toString(((i / 100) * 120))) + ",") + toString((((i / 100) * 120) / 18))) + ",0,") + toString(c)) + ",11"))])
2928 }
29+ else WriteSet([DataEntry(d, (((((((toString(b.amount) + ",") + toString(((b.amount / 100) * 120))) + ",") + toString((((b.amount / 100) * 120) / 18))) + ",0,") + toString(c)) + ",10"))])
3030 }
3131 }
3232
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 3 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44
55
66 @Callable(a)
77 func deposit () = {
88 let b = extract(a.payment)
99 let c = lastBlock.height
1010 if (isDefined(b.assetId))
1111 then throw("can hodl waves only at the moment")
1212 else {
1313 let d = toBase58String(a.caller.bytes)
1414 let e = {
1515 let f = getInteger(this, d)
1616 if ($isInstanceOf(f, "Int"))
1717 then {
1818 let g = f
1919 g
2020 }
2121 else 0
2222 }
23- if ((e == 0))
24- then WriteSet([DataEntry(d, (((((((toString(b.amount) + ",") + toString(((b.amount / 100) * 120))) + ",") + toString((((b.amount / 100) * 120) / 18))) + ",0,") + toString(c)) + ",10"))])
25- else {
23+ if ((e > 0))
24+ then {
2625 let h = split(toString(e), ",")
2726 let i = (e + b.amount)
2827 WriteSet([DataEntry(d, (((((((h[0] + ",") + toString(((i / 100) * 120))) + ",") + toString((((i / 100) * 120) / 18))) + ",0,") + toString(c)) + ",11"))])
2928 }
29+ else WriteSet([DataEntry(d, (((((((toString(b.amount) + ",") + toString(((b.amount / 100) * 120))) + ",") + toString((((b.amount / 100) * 120) / 18))) + ",0,") + toString(c)) + ",10"))])
3030 }
3131 }
3232
3333
3434
3535 @Callable(a)
3636 func withdraw (j) = {
3737 let d = toBase58String(a.caller.bytes)
3838 let e = {
3939 let f = getInteger(this, d)
4040 if ($isInstanceOf(f, "Int"))
4141 then {
4242 let g = f
4343 g
4444 }
4545 else 0
4646 }
4747 let i = (e - j)
4848 if ((0 > j))
4949 then throw("Can't withdraw negative amount")
5050 else if ((0 > i))
5151 then throw("Not enough balance")
5252 else ScriptResult(WriteSet([DataEntry(d, i)]), TransferSet([ScriptTransfer(a.caller, j, unit)]))
5353 }
5454
5555

github/deemru/w8io/169f3d6 
32.44 ms