tx · HNWDWgwWaVDkgwDphahtMawG5TdBaC7wYdbVJf5TBh4B

3NCv9hyL5NUbMMkTXYnN9hL9AMQd6f2eVww:  -0.01400000 Waves

2020.10.04 23:36 [1206317] smart account 3NCv9hyL5NUbMMkTXYnN9hL9AMQd6f2eVww > SELF 0.00000000 Waves

{ "type": 13, "id": "HNWDWgwWaVDkgwDphahtMawG5TdBaC7wYdbVJf5TBh4B", "fee": 1400000, "feeAssetId": null, "timestamp": 1601843773996, "version": 2, "chainId": 84, "sender": "3NCv9hyL5NUbMMkTXYnN9hL9AMQd6f2eVww", "senderPublicKey": "CNQtsB6HAGUVvb5L3NshmGW2pD94ysV6dzV6Zcf6BFCq", "proofs": [ "3bF1f1g4zwXSx7RVrkK5xUMJycXemeReGe9YNj6KhKSbK5R8EhXvNtSd8b5jJSr4iTF8fTpPz8McqwjGrBbYZuej" ], "script": "base64:AAIDAAAAAAAAAAkIARIAEgMKAQEAAAAAAAAAAgAAAAFpAQAAAAdkZXBvc2l0AAAAAAQAAAADcG10CQEAAAAHZXh0cmFjdAAAAAEIBQAAAAFpAAAAB3BheW1lbnQEAAAABHR0eHgIBQAAAAlsYXN0QmxvY2sAAAAGaGVpZ2h0AwkBAAAACWlzRGVmaW5lZAAAAAEIBQAAAANwbXQAAAAHYXNzZXRJZAkAAAIAAAABAgAAACFjYW4gaG9kbCB3YXZlcyBvbmx5IGF0IHRoZSBtb21lbnQEAAAACmN1cnJlbnRLZXkJAAJYAAAAAQgIBQAAAAFpAAAABmNhbGxlcgAAAAVieXRlcwQAAAANY3VycmVudEFtb3VudAQAAAAHJG1hdGNoMAkABBoAAAACBQAAAAR0aGlzBQAAAApjdXJyZW50S2V5AwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAAANJbnQEAAAAAWEFAAAAByRtYXRjaDAFAAAAAWEAAAAAAAAAAAAEAAAACW5ld0Ftb3VudAkAAGQAAAACBQAAAA1jdXJyZW50QW1vdW50CAUAAAADcG10AAAABmFtb3VudAMJAAA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VyAAAABWJ5dGVzBAAAAA1jdXJyZW50QW1vdW50BAAAAAckbWF0Y2gwCQAEGgAAAAIFAAAABHRoaXMFAAAACmN1cnJlbnRLZXkDCQAAAQAAAAIFAAAAByRtYXRjaDACAAAAA0ludAQAAAABYQUAAAAHJG1hdGNoMAUAAAABYQAAAAAAAAAAAAQAAAAJbmV3QW1vdW50CQAAZQAAAAIFAAAADWN1cnJlbnRBbW91bnQFAAAABmFtb3VudAMJAABmAAAAAgAAAAAAAAAAAAUAAAAGYW1vdW50CQAAAgAAAAECAAAAHkNhbid0IHdpdGhkcmF3IG5lZ2F0aXZlIGFtb3VudAMJAABmAAAAAgAAAAAAAAAAAAUAAAAJbmV3QW1vdW50CQAAAgAAAAECAAAAEk5vdCBlbm91Z2ggYmFsYW5jZQkBAAAADFNjcmlwdFJlc3VsdAAAAAIJAQAAAAhXcml0ZVNldAAAAAEJAARMAAAAAgkBAAAACURhdGFFbnRyeQAAAAIFAAAACmN1cnJlbnRLZXkFAAAACW5ld0Ftb3VudAUAAAADbmlsCQEAAAALVHJhbnNmZXJTZXQAAAABCQAETAAAAAIJAQAAAA5TY3JpcHRUcmFuc2ZlcgAAAAMIBQAAAAFpAAAABmNhbGxlcgUAAAAGYW1vdW50BQAAAAR1bml0BQAAAANuaWwAAAAAcFDq1Q==", "height": 1206317, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 6M1xCGMJ85Zx3VCDXdoqXk8bMF2ThaZHcf3E6DAV2eyp Next: 6LXguuSvnAfubUNFFWoxAc55QXzaPM8S6S1YPo4krp86 Diff:
OldNewDifferences
1717 case _ =>
1818 0
1919 }
20- if ((currentAmount > 0))
20+ let newAmount = (currentAmount + pmt.amount)
21+ if ((newAmount == pmt.amount))
2122 then {
2223 let oldAmount = split(toString(currentAmount), ",")
23- let newAmount = (currentAmount + pmt.amount)
2424 WriteSet([DataEntry(currentKey, (((((((oldAmount[0] + ",") + toString(((newAmount / 100) * 120))) + ",") + toString((((newAmount / 100) * 120) / 18))) + ",0,") + toString(ttxx)) + ",11"))])
2525 }
2626 else WriteSet([DataEntry(currentKey, (((((((toString(pmt.amount) + ",") + toString(((pmt.amount / 100) * 120))) + ",") + toString((((pmt.amount / 100) * 120) / 18))) + ",0,") + toString(ttxx)) + ",10"))])
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- if ((currentAmount > 0))
20+ let newAmount = (currentAmount + pmt.amount)
21+ if ((newAmount == pmt.amount))
2122 then {
2223 let oldAmount = split(toString(currentAmount), ",")
23- let newAmount = (currentAmount + pmt.amount)
2424 WriteSet([DataEntry(currentKey, (((((((oldAmount[0] + ",") + toString(((newAmount / 100) * 120))) + ",") + toString((((newAmount / 100) * 120) / 18))) + ",0,") + toString(ttxx)) + ",11"))])
2525 }
2626 else WriteSet([DataEntry(currentKey, (((((((toString(pmt.amount) + ",") + toString(((pmt.amount / 100) * 120))) + ",") + toString((((pmt.amount / 100) * 120) / 18))) + ",0,") + toString(ttxx)) + ",10"))])
2727 }
2828 }
2929
3030
3131
3232 @Callable(i)
3333 func withdraw (amount) = {
3434 let currentKey = toBase58String(i.caller.bytes)
3535 let currentAmount = match getInteger(this, currentKey) {
3636 case a: Int =>
3737 a
3838 case _ =>
3939 0
4040 }
4141 let newAmount = (currentAmount - amount)
4242 if ((0 > amount))
4343 then throw("Can't withdraw negative amount")
4444 else if ((0 > newAmount))
4545 then throw("Not enough balance")
4646 else ScriptResult(WriteSet([DataEntry(currentKey, newAmount)]), TransferSet([ScriptTransfer(i.caller, amount, unit)]))
4747 }
4848
4949

github/deemru/w8io/169f3d6 
26.56 ms