tx · Bo8FsrnwbVoY8YX22459tGpgvw8Dwj3tXAw4KU2qieKh

3MqxFhe869ri22Y1418TcrXUX2X9YMzG2Yb:  -0.01400000 Waves

2019.06.28 20:43 [562297] smart account 3MqxFhe869ri22Y1418TcrXUX2X9YMzG2Yb > SELF 0.00000000 Waves

{ "type": 13, "id": "Bo8FsrnwbVoY8YX22459tGpgvw8Dwj3tXAw4KU2qieKh", "fee": 1400000, "feeAssetId": null, "timestamp": 1561743831286, "version": 1, "sender": "3MqxFhe869ri22Y1418TcrXUX2X9YMzG2Yb", "senderPublicKey": "FRkBvFhV1T95mPTxp7sk2Ms2BuHViwyG7yPzxpxye1Kw", "proofs": [ "4es9x9Zs7SWoh3eFhCH8KdqVhekskeqEnkKGTLXJ1hnPMVFSNbNBsBoZMQXX6DVNabDQRuwvhnMMJ5fNfLnnXXNs" ], "script": "base64:AAIDAAAAAAAAAAAAAAALAAAAAApzZXJ2aWNlRmVlAAAAAAAAmJaAAAAAAAVlbXB0eQIAAAAETlVMTAAAAAASYWxsTWVzc2FnZUJvYXJkS2V5AgAAAAthbGxfbWVzc2FnZQAAAAAQYWN0aXZlTWVzc2FnZUtleQIAAAAOYWN0aXZlX21lc3NhZ2UAAAAADmVhcm5lZFdhdmVzS2V5AgAAAAtlYXJuZWRXYXZlcwAAAAANc2VydmljZUZlZUtleQIAAAAKc2VydmljZUZlZQAAAAAJZEFwcE93bmVyAgAAACMzTXZpS2U4dnlibmtZdUo4M2U4UVZTV1ExVkh5ZmdwaUYzVwEAAAAJdW5pcXVlS2V5AAAAAgAAAAVvd25lcgAAAAR0ZXh0BAAAAAR1S2V5CQACWAAAAAEJAAH3AAAAAQkAAZsAAAABCQABLAAAAAIFAAAABW93bmVyBQAAAAR0ZXh0BQAAAAR1S2V5AQAAAA5nZXROdW1iZXJCeUtleQAAAAEAAAADa2V5BAAAAANudW0EAAAAByRtYXRjaDAJAAQaAAAAAgUAAAAEdGhpcwUAAAADa2V5AwkAAAEAAAACBQAAAAck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RuJ3QgZm91bmQDCQEAAAACIT0AAAACBQAAAAVvd25lcgUAAAANc2VuZGVyQWRkcmVzcwkAAAIAAAABCQABLAAAAAICAAAAG1lvdSBkb24ndCBvd25lciBvZiBtZXNzYWdlIAUAAAAEdUtleQkBAAAACFdyaXRlU2V0AAAAAQkABEwAAAACCQEAAAAJRGF0YUVudHJ5AAAAAgUAAAAQYWN0aXZlTWVzc2FnZUtleQkAAGUAAAACBQAAAAphY3RNZXNzYWdlAAAAAAAAAAABCQAETAAAAAIJAQAAAAlEYXRhRW50cnkAAAACCQABLAAAAAICAAAACG1lc3NhZ2VfBQAAAAR1S2V5AgAAAAkjUkVNT1ZFRCMFAAAAA25pbAAAAAFpAQAAAA1zZXRTZXJ2aWNlRmVlAAAAAQAAAAZuZXdGZWUEAAAADXNlbmRlckFkZHJlc3MJAAJYAAAAAQgIBQAAAAFpAAAABmNhbGxlcgAAAAVieXRlcwMJAQAAAAIhPQAAAAIFAAAADXNlbmRlckFkZHJlc3MFAAAACWRBcHBPd25lcgkAAAIAAAABAgAAABpZb3UgYXJlbid0IG93bmVyIHRoaXMgZEFwcAkBAAAACFdyaXRlU2V0AAAAAQkABEwAAAACCQEAAAAJRGF0YUVudHJ5AAAAAgUAAAANc2VydmljZUZlZUtleQUAAAAGbmV3RmVlBQAAAANuaWwAAAAAuzxIPg==", "chainId": 84, "height": 562297, "spentComplexity": 0 } View: original | compacted Prev: 7p2nd2GTxzJ3wckcWQsqw82V1nbN9kUf5AYgj6MZg8ak Next: 9wSgnJX48JcP9wAseqknKRjYGEjwm7kw5rZ4y7RhzAW Diff:
OldNewDifferences
6868 let allMessage = getNumberByKey(allMessageBoardKey)
6969 let actMessage = getNumberByKey(activeMessageKey)
7070 let earnedWaves = getNumberByKey(earnedWavesKey)
71- WriteSet([DataEntry(("owner_" + uKey), ownerAddress), DataEntry(("message_" + uKey), text), DataEntry(allMessageBoardKey, (allMessage + 1)), DataEntry(activeMessageKey, (actMessage + 1)), DataEntry(earnedWavesKey, (earnedWaves + serviceFee))])
71+ WriteSet([DataEntry(("owner_" + uKey), ownerAddress), DataEntry(("message_" + uKey), text), DataEntry(allMessageBoardKey, (allMessage + 1)), DataEntry(activeMessageKey, (actMessage + 1)), DataEntry(earnedWavesKey, (earnedWaves + lFee))])
7272 }
7373 }
7474
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 3 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let serviceFee = 10000000
55
66 let empty = "NULL"
77
88 let allMessageBoardKey = "all_message"
99
1010 let activeMessageKey = "active_message"
1111
1212 let earnedWavesKey = "earnedWaves"
1313
1414 let serviceFeeKey = "serviceFee"
1515
1616 let dAppOwner = "3MviKe8vybnkYuJ83e8QVSWQ1VHyfgpiF3W"
1717
1818 func uniqueKey (owner,text) = {
1919 let uKey = toBase58String(sha256(toBytes((owner + text))))
2020 uKey
2121 }
2222
2323
2424 func getNumberByKey (key) = {
2525 let num = match getInteger(this, key) {
2626 case a: Int =>
2727 a
2828 case _ =>
2929 0
3030 }
3131 num
3232 }
3333
3434
3535 func getStrByKey (key) = {
3636 let str = match getString(this, key) {
3737 case a: String =>
3838 a
3939 case _ =>
4040 empty
4141 }
4242 str
4343 }
4444
4545
4646 func getSeviceFee () = {
4747 let fee = match getInteger(this, serviceFeeKey) {
4848 case a: Int =>
4949 a
5050 case _ =>
5151 serviceFee
5252 }
5353 fee
5454 }
5555
5656
5757 @Callable(i)
5858 func setMessage (text) = {
5959 let pmt = extract(i.payment)
6060 let lFee = getSeviceFee()
6161 if (isDefined(pmt.assetId))
6262 then throw("WAVES token only at the moment")
6363 else if ((pmt.amount != lFee))
6464 then throw("Wrong service fee amount")
6565 else {
6666 let ownerAddress = toBase58String(i.caller.bytes)
6767 let uKey = uniqueKey(ownerAddress, text)
6868 let allMessage = getNumberByKey(allMessageBoardKey)
6969 let actMessage = getNumberByKey(activeMessageKey)
7070 let earnedWaves = getNumberByKey(earnedWavesKey)
71- WriteSet([DataEntry(("owner_" + uKey), ownerAddress), DataEntry(("message_" + uKey), text), DataEntry(allMessageBoardKey, (allMessage + 1)), DataEntry(activeMessageKey, (actMessage + 1)), DataEntry(earnedWavesKey, (earnedWaves + serviceFee))])
71+ WriteSet([DataEntry(("owner_" + uKey), ownerAddress), DataEntry(("message_" + uKey), text), DataEntry(allMessageBoardKey, (allMessage + 1)), DataEntry(activeMessageKey, (actMessage + 1)), DataEntry(earnedWavesKey, (earnedWaves + lFee))])
7272 }
7373 }
7474
7575
7676
7777 @Callable(i)
7878 func removeMessage (uKey) = {
7979 let pmt = extract(i.payment)
8080 let owner = getStrByKey(("owner_" + uKey))
8181 let actMessage = getNumberByKey(activeMessageKey)
8282 let senderAddress = toBase58String(i.caller.bytes)
8383 if ((owner == empty))
8484 then throw("Message didn't found")
8585 else if ((owner != senderAddress))
8686 then throw(("You don't owner of message " + uKey))
8787 else WriteSet([DataEntry(activeMessageKey, (actMessage - 1)), DataEntry(("message_" + uKey), "#REMOVED#")])
8888 }
8989
9090
9191
9292 @Callable(i)
9393 func setServiceFee (newFee) = {
9494 let senderAddress = toBase58String(i.caller.bytes)
9595 if ((senderAddress != dAppOwner))
9696 then throw("You aren't owner this dApp")
9797 else WriteSet([DataEntry(serviceFeeKey, newFee)])
9898 }
9999
100100

github/deemru/w8io/169f3d6 
44.80 ms