tx · 5K7CNiAbFbVNHUKZrhQJB9yZo1fcztC3he2XgBkpnpxa 3Mu3U9HY7hEDtwMGJJoouk1uXzet7iKk2ZC: -0.01400000 Waves 2021.01.11 13:37 [1348673] smart account 3Mu3U9HY7hEDtwMGJJoouk1uXzet7iKk2ZC > SELF 0.00000000 Waves
{ "type": 13, "id": "5K7CNiAbFbVNHUKZrhQJB9yZo1fcztC3he2XgBkpnpxa", "fee": 1400000, "feeAssetId": null, "timestamp": 1610361431281, "version": 2, "chainId": 84, "sender": "3Mu3U9HY7hEDtwMGJJoouk1uXzet7iKk2ZC", "senderPublicKey": "4Z5G4h61KM7BosAwBocFUQgSSzBisTNzTdgvh1tUW6tR", "proofs": [ "2sQCNsCZiBxm28J1patpfEtjbQDZy6oxtufqY9auroPJsMkk3S3qK8y9rKfrESeUHwywK9pAEr1xZfgj7irhQtbi" ], "script": "base64:AAIEAAAAAAAAAAoIAhIGCgQICAgIAAAADAAAAAAFY2hyaXMCAAAAIzNNc0c2alBOQ3JWSlV0WUI3WEpCeFM3dXRXc1hBZjRuOVZwAAAAAARqb2VwAgAAACMzTXptNFZMd3NOOXVad2JUTXpQajNYdXhWNmtFZkFSOFVETgAAAAAHUEVORElORwIAAAAHUEVORElORwAAAAAIUkVKRUNURUQCAAAACFJFSkVDVEVEAAAAAAhBQ0NFUFRFRAIAAAAIQUNDRVBURUQAAAAAB1JFR1VMQVICAAAAB1JFR1VMQVIAAAAACEFQUFJPVkVEAgAAAAhBUFBST1ZFRAEAAAAOZ2V0U3RyaW5nQnlLZXkAAAABAAAAA2tleQkBAAAAC3ZhbHVlT3JFbHNlAAAAAgkABB0AAAACBQAAAAR0aGlzBQAAAANrZXkCAAAAAAEAAAALa2V5VXNlckpzb24AAAADAAAABmNhbGxlcgAAAAlyZXFTdGF0dXMAAAAGcmVzdWx0CQABLAAAAAIJAAEsAAAAAgkAASwAAAACCQABLAAAAAIJAAEsAAAAAgIAAAAKdXNlcl9qc29uXwUAAAAGY2FsbGVy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x0CQEAAAAIbWFrZUpTT04AAAAEBQAAAAlyZXFTdGF0dXMFAAAABnJlc3VsdAkAAloAAAABCQABmwAAAAEFAAAAA21zZwkAAaQAAAABBQAAAAl0aW1lc3RhbXAFAAAAA25pbAkAAAIAAAABAgAAACFOb3QgYWxsb3dlZCB0byBjaGFuZ2UgdXNlciBzdGF0dXMAAAAAJ+eWxw==", "height": 1348673, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: none Next: none Full:
Old | New | Differences | |
---|---|---|---|
1 | - | # no script | |
1 | + | {-# STDLIB_VERSION 4 #-} | |
2 | + | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | + | {-# CONTENT_TYPE DAPP #-} | |
4 | + | let chris = "3MsG6jPNCrVJUtYB7XJBxS7utWsXAf4n9Vp" | |
5 | + | ||
6 | + | let joep = "3Mzm4VLwsN9uZwbTMzPj3XuxV6kEfAR8UDN" | |
7 | + | ||
8 | + | let PENDING = "PENDING" | |
9 | + | ||
10 | + | let REJECTED = "REJECTED" | |
11 | + | ||
12 | + | let ACCEPTED = "ACCEPTED" | |
13 | + | ||
14 | + | let REGULAR = "REGULAR" | |
15 | + | ||
16 | + | let APPROVED = "APPROVED" | |
17 | + | ||
18 | + | func getStringByKey (key) = valueOrElse(getString(this, key), "") | |
19 | + | ||
20 | + | ||
21 | + | func keyUserJson (caller,reqStatus,result) = ((((("user_json_" + caller) + "_") + reqStatus) + "_") + result) | |
22 | + | ||
23 | + | ||
24 | + | func keyUserRequest (caller) = ("user_request_" + caller) | |
25 | + | ||
26 | + | ||
27 | + | func keyUserResult (caller) = ("user_result_" + caller) | |
28 | + | ||
29 | + | ||
30 | + | func makeJSON (requestStatus,result,msg,timestamp) = (((((((("{\"requestStatus\": \"" + requestStatus) + "\", \"result\": \"") + result) + "\", \"message\":\"") + msg) + "\",\"timestamp\":\"") + timestamp) + "\"}") | |
31 | + | ||
32 | + | ||
33 | + | @Callable(i) | |
34 | + | func setStatus (address,reqStatus,result,msg) = { | |
35 | + | let caller = toString(addressFromPublicKey(i.callerPublicKey)) | |
36 | + | let id = toBase58String(i.transactionId) | |
37 | + | let timestamp = lastBlock.timestamp | |
38 | + | let currentRequest = getStringByKey(keyUserRequest(address)) | |
39 | + | let currentResult = getStringByKey(keyUserResult(address)) | |
40 | + | let resultToSet = if (containsElement([PENDING, REJECTED, ACCEPTED], result)) | |
41 | + | then result | |
42 | + | else throw("Unknown result for requested status") | |
43 | + | let requestedStatus = if (containsElement([REGULAR, APPROVED], reqStatus)) | |
44 | + | then reqStatus | |
45 | + | else throw("Unknown status request") | |
46 | + | if (containsElement([chris, joep, toString(this)], caller)) | |
47 | + | then [DeleteEntry(keyUserJson(address, currentRequest, currentResult)), StringEntry(keyUserRequest(address), reqStatus), StringEntry(keyUserResult(address), result), StringEntry(keyUserJson(address, reqStatus, result), makeJSON(reqStatus, result, toBase64String(toBytes(msg)), toString(timestamp)))] | |
48 | + | else throw("Not allowed to change user status") | |
49 | + | } | |
50 | + | ||
51 | + |
github/deemru/w8io/169f3d6 20.00 ms ◑