tx · 9wSgnJX48JcP9wAseqknKRjYGEjwm7kw5rZ4y7RhzAW

3MqxFhe869ri22Y1418TcrXUX2X9YMzG2Yb:  -0.01400000 Waves

2019.06.28 21:07 [562320] smart account 3MqxFhe869ri22Y1418TcrXUX2X9YMzG2Yb > SELF 0.00000000 Waves

{ "type": 13, "id": "9wSgnJX48JcP9wAseqknKRjYGEjwm7kw5rZ4y7RhzAW", "fee": 1400000, "feeAssetId": null, "timestamp": 1561745259300, "version": 1, "sender": "3MqxFhe869ri22Y1418TcrXUX2X9YMzG2Yb", "senderPublicKey": "FRkBvFhV1T95mPTxp7sk2Ms2BuHViwyG7yPzxpxye1Kw", "proofs": [ "2Uo8T7zonBwLDmPp1m4eoN7aNmuaGPNGxweVeFBkAvSD3TNK2X78aycLg4CvMa6LeFGbgm9nAvKx2KLmzEcj716t" ], "script": "base64:AAIDAAAAAAAAAAAAAAALAAAAAApzZXJ2aWNlRmVlAAAAAAAAmJaAAAAAAAVlbXB0eQIAAAAETlVMTAAAAAASYWxsTWVzc2FnZUJvYXJkS2V5AgAAAAthbGxfbWVzc2FnZQAAAAAQYWN0aXZlTWVzc2FnZUtleQIAAAAOYWN0aXZlX21lc3NhZ2UAAAAADmVhcm5lZFdhdmVzS2V5AgAAAAtlYXJuZWRXYXZlcwAAAAANc2VydmljZUZlZUtleQIAAAAKc2VydmljZUZlZQAAAAAJZEFwcE93bmVyAgAAACMzTXZpS2U4dnlibmtZdUo4M2U4UVZTV1ExVkh5ZmdwaUYzVwEAAAAJdW5pcXVlS2V5AAAAAgAAAAVvd25lcgAAAAR0ZXh0BAAAAAR1S2V5CQACWAAAAAEJAAH3AAAAAQkAAZsAAAABCQABLAAAAAIFAAAABW93bmVyBQAAAAR0ZXh0BQAAAAR1S2V5AQAAAA5nZXROdW1iZXJCeUtleQAAAAEAAAADa2V5BAAAAANudW0EAAAAByRtYXRjaDAJAAQaAAAAAgUAAAAEdGhpcwUAAAADa2V5AwkAAAEAAAACBQAAAAckbWF0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kAAAACBQAAABBhY3RpdmVNZXNzYWdlS2V5CQAAZQAAAAIFAAAACmFjdE1lc3NhZ2UAAAAAAAAAAAEJAARMAAAAAgkBAAAACURhdGFFbnRyeQAAAAIJAAEsAAAAAgIAAAAIbWVzc2FnZV8FAAAABHVLZXkCAAAAFCNWSU9MQVRJT04gT0YgUlVMRVMjBQAAAANuaWwAAAAA8fRtTg==", "chainId": 84, "height": 562320, "spentComplexity": 0 } View: original | compacted Prev: Bo8FsrnwbVoY8YX22459tGpgvw8Dwj3tXAw4KU2qieKh Next: DHX94DphffTH9sh442cCJYHDQS1qcTTq7mzw9pVAqAot Diff:
OldNewDifferences
5757 @Callable(i)
5858 func setMessage (text) = {
5959 let pmt = extract(i.payment)
60- let lFee = getSeviceFee()
60+ let localFee = getSeviceFee()
6161 if (isDefined(pmt.assetId))
6262 then throw("WAVES token only at the moment")
63- else if ((pmt.amount != lFee))
63+ else if ((pmt.amount != localFee))
6464 then throw("Wrong service fee amount")
6565 else {
6666 let ownerAddress = toBase58String(i.caller.bytes)
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 + lFee))])
71+ WriteSet([DataEntry(("owner_" + uKey), ownerAddress), DataEntry(("message_" + uKey), text), DataEntry(allMessageBoardKey, (allMessage + 1)), DataEntry(activeMessageKey, (actMessage + 1)), DataEntry(earnedWavesKey, (earnedWaves + localFee))])
7272 }
7373 }
7474
7676
7777 @Callable(i)
7878 func removeMessage (uKey) = {
79- let pmt = extract(i.payment)
8079 let owner = getStrByKey(("owner_" + uKey))
8180 let actMessage = getNumberByKey(activeMessageKey)
8281 let senderAddress = toBase58String(i.caller.bytes)
9897 }
9998
10099
100+
101+@Callable(i)
102+func violationDetected (uKey) = {
103+ let actMessage = getNumberByKey(activeMessageKey)
104+ let senderAddress = toBase58String(i.caller.bytes)
105+ if ((senderAddress != dAppOwner))
106+ then throw("You aren't owner this dApp")
107+ else WriteSet([DataEntry(activeMessageKey, (actMessage - 1)), DataEntry(("message_" + uKey), "#VIOLATION OF RULES#")])
108+ }
109+
110+
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)
60- let lFee = getSeviceFee()
60+ let localFee = getSeviceFee()
6161 if (isDefined(pmt.assetId))
6262 then throw("WAVES token only at the moment")
63- else if ((pmt.amount != lFee))
63+ else if ((pmt.amount != localFee))
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 + lFee))])
71+ WriteSet([DataEntry(("owner_" + uKey), ownerAddress), DataEntry(("message_" + uKey), text), DataEntry(allMessageBoardKey, (allMessage + 1)), DataEntry(activeMessageKey, (actMessage + 1)), DataEntry(earnedWavesKey, (earnedWaves + localFee))])
7272 }
7373 }
7474
7575
7676
7777 @Callable(i)
7878 func removeMessage (uKey) = {
79- let pmt = extract(i.payment)
8079 let owner = getStrByKey(("owner_" + uKey))
8180 let actMessage = getNumberByKey(activeMessageKey)
8281 let senderAddress = toBase58String(i.caller.bytes)
8382 if ((owner == empty))
8483 then throw("Message didn't found")
8584 else if ((owner != senderAddress))
8685 then throw(("You don't owner of message " + uKey))
8786 else WriteSet([DataEntry(activeMessageKey, (actMessage - 1)), DataEntry(("message_" + uKey), "#REMOVED#")])
8887 }
8988
9089
9190
9291 @Callable(i)
9392 func setServiceFee (newFee) = {
9493 let senderAddress = toBase58String(i.caller.bytes)
9594 if ((senderAddress != dAppOwner))
9695 then throw("You aren't owner this dApp")
9796 else WriteSet([DataEntry(serviceFeeKey, newFee)])
9897 }
9998
10099
100+
101+@Callable(i)
102+func violationDetected (uKey) = {
103+ let actMessage = getNumberByKey(activeMessageKey)
104+ let senderAddress = toBase58String(i.caller.bytes)
105+ if ((senderAddress != dAppOwner))
106+ then throw("You aren't owner this dApp")
107+ else WriteSet([DataEntry(activeMessageKey, (actMessage - 1)), DataEntry(("message_" + uKey), "#VIOLATION OF RULES#")])
108+ }
109+
110+

github/deemru/w8io/169f3d6 
26.07 ms