tx · 3c2xPB8Q5EEee9DTQiAwBVP4wbdJh9YLzh86zb8Yt5XY

3MzLFtW4HAnHScA7x9AoxtiiPrGPLyKdK5f:  -0.01400000 Waves

2021.01.10 12:20 [1347141] smart account 3MzLFtW4HAnHScA7x9AoxtiiPrGPLyKdK5f > SELF 0.00000000 Waves

{ "type": 13, "id": "3c2xPB8Q5EEee9DTQiAwBVP4wbdJh9YLzh86zb8Yt5XY", "fee": 1400000, "feeAssetId": null, "timestamp": 1610270438566, "version": 2, "chainId": 84, "sender": "3MzLFtW4HAnHScA7x9AoxtiiPrGPLyKdK5f", "senderPublicKey": "6wBzB7Bw3oZwcxqF44P6x9GRDda14XkVXQdfCQSAWpeP", "proofs": [ "pQeV53SB9Me6u2sBR6V2CUNmFf6qcj1Nd9bttXBegvHpRBZfxFaAZ1jb7iNtcsZcqR8yyytgWYFRoSjGjzQsbpx" ], "script": "base64:AAIEAAAAAAAAAAkIAhIFCgMICAgAAAAKAAAAAAVjaHJpcwIAAAAjM01zRzZqUE5DclZKVXRZQjdYSkJ4Uzd1dFdzWEFmNG45VnAAAAAABGpvZXACAAAAIzNNem00Vkx3c045dVp3YlRNelBqM1h1eFY2a0VmQVI4VUROAAAAAAhyZWNlaXZlZAIAAAAIUkVDRUlWRUQAAAAACHJlamVjdGVkAgAAAAhSRUpFQ1RFRAAAAAAIYWNjZXB0ZWQCAAAACEFDQ0VQVEVEAQAAAA5nZXRTdHJpbmdCeUtleQAAAAEAAAADa2V5CQEAAAALdmFsdWVPckVsc2UAAAACCQAEHQAAAAIFAAAABHRoaXMFAAAAA2tleQIAAAAAAQAAAA1rZXlVc2VyU3RhdHVzAAAAAQAAAAZjYWxsZXIJAAEsAAAAAgIAAAAFdXNlcl8FAAAABmNhbGxlcgEAAAAOa2V5VXNlck1lc3NhZ2UAAAABAAAABmNhbGxlcgkAASwAAAACAgAAAARtc2dfBQAAAAZjYWxsZXIBAAAADWtleVVzZXJVcGRhdGUAAAABAAAABmNhbGxlcgkAASw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W5zRWxlbWVudAAAAAIJAARMAAAAAgUAAAAFY2hyaXMJAARMAAAAAgUAAAAEam9lcAkABEwAAAACCQAEJQAAAAEFAAAABHRoaXMFAAAAA25pbAUAAAAGY2FsbGVyCQAETAAAAAIJAQAAAAtTdHJpbmdFbnRyeQAAAAIJAQAAAA1rZXlVc2VyU3RhdHVzAAAAAQUAAAAHYWRkcmVzcwkBAAAACG1ha2VKU09OAAAAAwUAAAALc3RhdHVzVG9TZXQJAAJaAAAAAQkAAZsAAAABBQAAAANtc2cJAAGkAAAAAQUAAAAJdGltZXN0YW1wBQAAAANuaWwJAAACAAAAAQIAAAAhTm90IGFsbG93ZWQgdG8gY2hhbmdlIHVzZXIgc3RhdHVzAAAAALyzXog=", "height": 1347141, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 8xJT4YYGVjt3ykdwu7SNGvV24L6RQxyVipX1zmeZn513 Next: 4NJ59iwCA4nvPbJQLZzMw9ubZKMubhr3TzRJAwbopYxV Diff:
OldNewDifferences
4040 else false)
4141 then throw("Application exist already")
4242 else if (containsElement([chris, joep, toString(this)], caller))
43- then [StringEntry(keyUserStatus(address), makeJSON(address, toBase64String(toBytes(msg)), toString(timestamp)))]
43+ then [StringEntry(keyUserStatus(address), makeJSON(statusToSet, toBase64String(toBytes(msg)), toString(timestamp)))]
4444 else throw("Not allowed to change user status")
4545 }
4646
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 4 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let chris = "3MsG6jPNCrVJUtYB7XJBxS7utWsXAf4n9Vp"
55
66 let joep = "3Mzm4VLwsN9uZwbTMzPj3XuxV6kEfAR8UDN"
77
88 let received = "RECEIVED"
99
1010 let rejected = "REJECTED"
1111
1212 let accepted = "ACCEPTED"
1313
1414 func getStringByKey (key) = valueOrElse(getString(this, key), "")
1515
1616
1717 func keyUserStatus (caller) = ("user_" + caller)
1818
1919
2020 func keyUserMessage (caller) = ("msg_" + caller)
2121
2222
2323 func keyUserUpdate (caller) = ("update_" + caller)
2424
2525
2626 func makeJSON (statusToSet,msg,timestamp) = (((((("{\"status\": \"" + statusToSet) + "\", \"message\":\"") + msg) + "\",\"timestamp\":\"") + timestamp) + "\"}")
2727
2828
2929 @Callable(i)
3030 func setStatus (address,status,msg) = {
3131 let caller = toString(addressFromPublicKey(i.callerPublicKey))
3232 let id = toBase58String(i.transactionId)
3333 let currentStatus = getStringByKey(keyUserStatus(address))
3434 let timestamp = lastBlock.timestamp
3535 let statusToSet = if (containsElement([received, rejected, accepted], status))
3636 then status
3737 else throw("Unknown status")
3838 if (if ((currentStatus == received))
3939 then (status == received)
4040 else false)
4141 then throw("Application exist already")
4242 else if (containsElement([chris, joep, toString(this)], caller))
43- then [StringEntry(keyUserStatus(address), makeJSON(address, toBase64String(toBytes(msg)), toString(timestamp)))]
43+ then [StringEntry(keyUserStatus(address), makeJSON(statusToSet, toBase64String(toBytes(msg)), toString(timestamp)))]
4444 else throw("Not allowed to change user status")
4545 }
4646
4747

github/deemru/w8io/169f3d6 
30.23 ms