tx · EKxJ2EDq1ENFJNLCDDRWXkWUg57BvYHNejYWdpN6h3pZ

3MqxFhe869ri22Y1418TcrXUX2X9YMzG2Yb:  -0.01400000 Waves

2019.06.28 05:45 [561399] smart account 3MqxFhe869ri22Y1418TcrXUX2X9YMzG2Yb > SELF 0.00000000 Waves

{ "type": 13, "id": "EKxJ2EDq1ENFJNLCDDRWXkWUg57BvYHNejYWdpN6h3pZ", "fee": 1400000, "feeAssetId": null, "timestamp": 1561689980105, "version": 1, "sender": "3MqxFhe869ri22Y1418TcrXUX2X9YMzG2Yb", "senderPublicKey": "FRkBvFhV1T95mPTxp7sk2Ms2BuHViwyG7yPzxpxye1Kw", "proofs": [ "3L8Sog73rdbxXujVvgwkVf3VZW7eKikXC1KPoUimzoYc8gYns4QcTpdcUGVUWuyQCoqWS5G8RA9kYXkfKNbVWHGU" ], "script": "base64:AAIDAAAAAAAAAAAAAAAFAAAAAAhwcmljZWFkdgAAAAAAAJiWgAAAAAASYWxsTWVzc2FnZUJvYXJkS2V5AgAAAAthbGxfbWVzc2FnZQAAAAAQYWN0aXZlTWVzc2FnZUtleQIAAAAOYWN0aXZlX21lc3NhZ2UBAAAACXVuaXF1ZUtleQAAAAIAAAAFb3duZXIAAAAEdGV4dAQAAAAEdUtleQkAAlgAAAABCQAB9wAAAAEJAAGbAAAAAQkAASwAAAACBQAAAAVvd25lcgUAAAAEdGV4dAUAAAAEdUtleQEAAAAOZ2V0TnVtYmVyQnlLZXkAAAABAAAAA2tleQQAAAADbnVtBAAAAAckbWF0Y2gwCQAEGgAAAAIFAAAABHRoaXMFAAAAA2tleQMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAADSW50BAAAAAFhBQAAAAckbWF0Y2gwBQAAAAFhAAAAAAAAAAAABQAAAANudW0AAAABAAAAAWkBAAAABnNldEFkdgAAAAEAAAAEdGV4dAQAAAADcG10CQEAAAAHZXh0cmFjdAAAAAEIBQAAAAFpAAAAB3BheW1lbnQDCQEAAAAJaXNEZWZpbmVkAAAAAQgFAAAAA3BtdAAAAAdhc3NldElkCQAAAgAAAAECAAAAHldBVkVTIHRva2VuIG9ubHkgYXQgdGhlIG1vbWVudAMJAQAAAAIhPQAAAAIIBQAAAANwbXQAAAAGYW1vdW50BQAAAAhwcmljZWFkdgkAAAIAAAABAgAAABZZb3UgbmVlZCBwYXkgMC4xIFdBVkVTBAAAAAxvd25lckFkZHJlc3MJAAJYAAAAAQgIBQAAAAFpAAAABmNhbGxlcgAAAAVieXRlcwQAAAAEdUtleQkBAAAACXVuaXF1ZUtleQAAAAIFAAAADG93bmVyQWRkcmVzcwUAAAAEdGV4dAQAAAAKYWxsTWVzc2FnZQkBAAAADmdldE51bWJlckJ5S2V5AAAAAQUAAAASYWxsTWVzc2FnZUJvYXJkS2V5BAAAAAphY3RNZXNzYWdlCQEAAAAOZ2V0TnVtYmVyQnlLZXkAAAABBQAAABBhY3RpdmVNZXNzYWdlS2V5CQEAAAAIV3JpdGVTZXQAAAABCQAETAAAAAIJAQAAAAlEYXRhRW50cnkAAAACCQABLAAAAAICAAAABm93bmVyXwUAAAAEdUtleQUAAAAMb3duZXJBZGRyZXNzCQAETAAAAAIJAQAAAAlEYXRhRW50cnkAAAACCQABLAAAAAICAAAACG1lc3NhZ2VfBQAAAAR1S2V5BQAAAAR0ZXh0CQAETAAAAAIJAQAAAAlEYXRhRW50cnkAAAACBQAAABJhbGxNZXNzYWdlQm9hcmRLZXkJAABkAAAAAgUAAAAKYWxsTWVzc2FnZQAAAAAAAAAAAQkABEwAAAACCQEAAAAJRGF0YUVudHJ5AAAAAgUAAAAQYWN0aXZlTWVzc2FnZUtleQkAAGQAAAACBQAAAAphY3RNZXNzYWdlAAAAAAAAAAABBQAAAANuaWwAAAAAmN4UqA==", "chainId": 84, "height": 561399, "spentComplexity": 0 } View: original | compacted Prev: 3VrtCofmHSmCCAxwkTZmDFxocb1kMAajDHxXwpXArEyG Next: 6V5htFLFAefvn6jwNrPdn5noA7Z8GLkTFE7Lc84Gr6A7 Diff:
OldNewDifferences
33 {-# CONTENT_TYPE DAPP #-}
44 let priceadv = 10000000
55
6+let allMessageBoardKey = "all_message"
7+
8+let activeMessageKey = "active_message"
9+
610 func uniqueKey (owner,text) = {
711 let uKey = toBase58String(sha256(toBytes((owner + text))))
812 uKey
13+ }
14+
15+
16+func getNumberByKey (key) = {
17+ let num = match getInteger(this, key) {
18+ case a: Int =>
19+ a
20+ case _ =>
21+ 0
22+ }
23+ num
924 }
1025
1126
1934 else {
2035 let ownerAddress = toBase58String(i.caller.bytes)
2136 let uKey = uniqueKey(ownerAddress, text)
22- WriteSet([DataEntry(("owner_" + uKey), ownerAddress), DataEntry(("message_" + uKey), text)])
37+ let allMessage = getNumberByKey(allMessageBoardKey)
38+ let actMessage = getNumberByKey(activeMessageKey)
39+ WriteSet([DataEntry(("owner_" + uKey), ownerAddress), DataEntry(("message_" + uKey), text), DataEntry(allMessageBoardKey, (allMessage + 1)), DataEntry(activeMessageKey, (actMessage + 1))])
2340 }
2441 }
2542
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 3 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let priceadv = 10000000
55
6+let allMessageBoardKey = "all_message"
7+
8+let activeMessageKey = "active_message"
9+
610 func uniqueKey (owner,text) = {
711 let uKey = toBase58String(sha256(toBytes((owner + text))))
812 uKey
13+ }
14+
15+
16+func getNumberByKey (key) = {
17+ let num = match getInteger(this, key) {
18+ case a: Int =>
19+ a
20+ case _ =>
21+ 0
22+ }
23+ num
924 }
1025
1126
1227 @Callable(i)
1328 func setAdv (text) = {
1429 let pmt = extract(i.payment)
1530 if (isDefined(pmt.assetId))
1631 then throw("WAVES token only at the moment")
1732 else if ((pmt.amount != priceadv))
1833 then throw("You need pay 0.1 WAVES")
1934 else {
2035 let ownerAddress = toBase58String(i.caller.bytes)
2136 let uKey = uniqueKey(ownerAddress, text)
22- WriteSet([DataEntry(("owner_" + uKey), ownerAddress), DataEntry(("message_" + uKey), text)])
37+ let allMessage = getNumberByKey(allMessageBoardKey)
38+ let actMessage = getNumberByKey(activeMessageKey)
39+ WriteSet([DataEntry(("owner_" + uKey), ownerAddress), DataEntry(("message_" + uKey), text), DataEntry(allMessageBoardKey, (allMessage + 1)), DataEntry(activeMessageKey, (actMessage + 1))])
2340 }
2441 }
2542
2643

github/deemru/w8io/169f3d6 
114.79 ms