tx · 4GzpYMgBG38yFstgGFt9NccgdzdM7FK69EHMQj4Xr5Vo 3MqxhXjG6DVDwFuLsaBz7sgt38iwHj9Da7f: -0.00300000 Waves 2022.10.02 15:06 [2254697] smart account 3MqxhXjG6DVDwFuLsaBz7sgt38iwHj9Da7f > SELF 0.00000000 Waves
{ "type": 13, "id": "4GzpYMgBG38yFstgGFt9NccgdzdM7FK69EHMQj4Xr5Vo", "fee": 300000, "feeAssetId": null, "timestamp": 1664712422623, "version": 2, "chainId": 84, "sender": "3MqxhXjG6DVDwFuLsaBz7sgt38iwHj9Da7f", "senderPublicKey": "24F9Fvi53bZzs4e399kBtXVRriDkrJjjVpfMwrVBfX9N", "proofs": [ "5RfEduDX6DAboZFsoN5UuLPZdJu4M4ZKcqaFMDJNwZqptYTTJ9BfwJofcRfXuKUvLAy5k3jnmHkDJJ48UGQ9E4oB" ], "script": "base64:BgIhCAISCgoICAgICAgICAgSBQoDCAgIEgQKAggIEgQKAggIBQAQYWRtaW5fd2FsbGV0X29uZQIjM044eDltYjQ4MWkyazZjRzdROVhVVjNlNW56aDFtZHpzTnkAEGFkbWluX3dhbGxldF90d28CIzNOM0RDbmdqaWRpdmtKYlRKd0ZURXZiWVJUZmZDV1ZCTENMABJhZG1pbl93YWxsZXRfdGhyZWUCIzNOOTFWQmt0b1RQU0JMNk5rSFJzQU0xRExXSDJUNnF2UXJzARRjaGVja19hZG1pbnNfd2FsbGV0cwELdXNlcl93YWxsZXQDAwMJAAACBQt1c2VyX3dhbGxldAUQYWRtaW5fd2FsbGV0X29uZQYJAAACBQt1c2VyX3dhbGxldAUQYWRtaW5fd2FsbGV0X3R3bwYJAAACBQt1c2VyX3dhbGxldAUSYWRtaW5fd2FsbGV0X3RocmVlBgcBDXRyeUdldEludGVnZXIBA2tleQQHJG1hdGNoMAkAmggCBQR0aGlzBQNrZXkDCQABAgUHJG1hdGNoMAIDSW50BAFiBQckbWF0Y2gwBQFiAAAEAWkBDXNldF91c2VyX2RhdGEIBndh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gISwgYWRkX3RvX2Zhdm9yaXRlcywgTUVTU0FHRTogc29ycnkgeW91IGFyZSBub3QgYWxsb3cgdG8gaW52b2tlIHRoaXMgZnVuYWN0aW9uAQJ0eAEGdmVyaWZ5AAkA9AMDCAUCdHgJYm9keUJ5dGVzCQCRAwIIBQJ0eAZwcm9vZnMAAAgFAnR4D3NlbmRlclB1YmxpY0tlebhi8ls=", "height": 2254697, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 2Ur28H9Az7hoUUBAZHkvJQP7p9H1A1pBkKuJKVouuaxz Next: 88cmXy8NwUaS11eb2bAoBZ2GQip245grrU4qfbRAPuG1 Full:
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 6 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let admin_wallet_one = "3N8x9mb481i2k6cG7Q9XUV3e5nzh1mdzsNy" | |
5 | 5 | ||
6 | 6 | let admin_wallet_two = "3N3DCngjidivkJbTJwFTEvbYRTffCWVBLCL" | |
7 | 7 | ||
8 | 8 | let admin_wallet_three = "3N91VBktoTPSBL6NkHRsAM1DLWH2T6qvQrs" | |
9 | 9 | ||
10 | 10 | func check_admins_wallets (user_wallet) = if (if (if ((user_wallet == admin_wallet_one)) | |
11 | 11 | then true | |
12 | 12 | else (user_wallet == admin_wallet_two)) | |
13 | 13 | then true | |
14 | 14 | else (user_wallet == admin_wallet_three)) | |
15 | 15 | then true | |
16 | 16 | else false | |
17 | 17 | ||
18 | 18 | ||
19 | 19 | func tryGetInteger (key) = match getInteger(this, key) { | |
20 | 20 | case b: Int => | |
21 | 21 | b | |
22 | 22 | case _ => | |
23 | 23 | 0 | |
24 | 24 | } | |
25 | 25 | ||
26 | 26 | ||
27 | 27 | @Callable(i) | |
28 | 28 | func set_user_data (wallet,name,image_link,cover_link,bio,google_analytics,yandex_analytics,notes) = if (if ((toString(i.caller) == wallet)) | |
29 | 29 | then true | |
30 | 30 | else check_admins_wallets(toString(i.caller))) | |
31 | 31 | then [StringEntry((("user_" + wallet) + "_joined"), "yes"), StringEntry((("user_" + wallet) + "_name"), name), StringEntry((("user_" + wallet) + "_imageLink"), image_link), StringEntry((("user_" + wallet) + "_coverLink"), cover_link), StringEntry((("user_" + wallet) + "_bio"), bio), StringEntry((("user_" + wallet) + "_googleAnalytics"), google_analytics), StringEntry((("user_" + wallet) + "_yandexAnalytics"), yandex_analytics), StringEntry((("user_" + wallet) + "_notes"), notes)] | |
32 | 32 | else throw("ERRROR !, set_user_data, MESSAGE: sorry you are not allow to invoke this funaction") | |
33 | 33 | ||
34 | 34 | ||
35 | 35 | ||
36 | 36 | @Callable(i) | |
37 | 37 | func set_verified_user (wallet,name,notes) = if (check_admins_wallets(toString(i.caller))) | |
38 | 38 | then [StringEntry((("user_" + wallet) + "_verified"), "yes"), StringEntry((("user_" + wallet) + "_verified_name"), name), StringEntry((("user_" + wallet) + "_verified_notes"), notes)] | |
39 | 39 | else throw("ERRROR !, set_verified_user, MESSAGE: sorry you are not allow to invoke this funaction") | |
40 | 40 | ||
41 | 41 | ||
42 | 42 | ||
43 | 43 | @Callable(i) | |
44 | 44 | func add_blog_to_favorites (wallet,blog_tx_id) = if (if ((toString(i.caller) == wallet)) | |
45 | 45 | then true | |
46 | 46 | else check_admins_wallets(toString(i.caller))) | |
47 | 47 | then { | |
48 | 48 | let id = tryGetInteger((("blog_" + blog_tx_id) + "favorite_id")) | |
49 | 49 | let user_id = tryGetInteger((("user_" + wallet) + "favorite_id")) | |
50 | 50 | [StringEntry(((("user_" + wallet) + "_blog_favorite_") + toString(user_id)), blog_tx_id), StringEntry(((("blog_" + blog_tx_id) + "_favorite_") + toString(id)), wallet), IntegerEntry((("blog_" + blog_tx_id) + "_favorite_id"), (id + 1)), IntegerEntry((("user_" + wallet) + "favorite_id"), (user_id + 1))] | |
51 | 51 | } | |
52 | 52 | else throw("ERRROR !, add_to_favorites, MESSAGE: sorry you are not allow to invoke this funaction") | |
53 | 53 | ||
54 | 54 | ||
55 | 55 | ||
56 | 56 | @Callable(i) | |
57 | 57 | func add_story_to_favorites (wallet,story_tx_id) = if (if ((toString(i.caller) == wallet)) | |
58 | 58 | then true | |
59 | 59 | else check_admins_wallets(toString(i.caller))) | |
60 | 60 | then { | |
61 | 61 | let id = tryGetInteger((("story_" + story_tx_id) + "favorite_id")) | |
62 | 62 | let user_id = tryGetInteger((("user_" + wallet) + "favorite_id")) | |
63 | 63 | [StringEntry(((("user_" + wallet) + "_story_favorite_") + toString(user_id)), story_tx_id), StringEntry(((("story_" + story_tx_id) + "_favorite_") + toString(id)), wallet), IntegerEntry((("story_" + story_tx_id) + "_favorite_id"), (id + 1)), IntegerEntry((("user_" + wallet) + "favorite_id"), (user_id + 1))] | |
64 | 64 | } | |
65 | 65 | else throw("ERRROR !, add_to_favorites, MESSAGE: sorry you are not allow to invoke this funaction") | |
66 | 66 | ||
67 | 67 | ||
68 | 68 | @Verifier(tx) | |
69 | 69 | func verify () = sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) | |
70 | 70 |
github/deemru/w8io/169f3d6 46.10 ms ◑