tx · HDgeSD8uyxLjQ7QMZcHrrThqZsyZwz9AvzzijKs1ZJNw 3NCKxCFvhVBofwUEsDBkqk55mbhYUfL5T5r: -0.01900000 Waves 2021.04.17 20:17 [1486741] smart account 3NCKxCFvhVBofwUEsDBkqk55mbhYUfL5T5r > SELF 0.00000000 Waves
{ "type": 13, "id": "HDgeSD8uyxLjQ7QMZcHrrThqZsyZwz9AvzzijKs1ZJNw", "fee": 1900000, "feeAssetId": null, "timestamp": 1618679886292, "version": 2, "chainId": 84, "sender": "3NCKxCFvhVBofwUEsDBkqk55mbhYUfL5T5r", "senderPublicKey": "esN64qS6iTUbZmuSxxS8bsKaDDJthNYr3zViLVdG8Sc", "proofs": [ "2nzwU9D3N8w923MBS259YjmZv1FZ2i69aViQoscDzZVzY29yBEtdj9PBp1XziLmNrxWt4Siw3GBR2aewZgd4ZYnJ" ], "script": "base64:AAIDAAAAAAAAAAwIARIDCgEIEgMKAQgAAAAIAAAAAAxtYWluQ29udHJhY3QJAQAAABxAZXh0clVzZXIoYWRkcmVzc0Zyb21TdHJpbmcpAAAAAQIAAAAjM04yYUcybmE2RFp0dDVKb29xNGM5Z2Vuc1lXY2g0TUNTWVMBAAAADXRyeUdldEludGVnZXIAAAABAAAAA2tleQQAAAADdmFsBAAAAAckbWF0Y2gwCQAEGgAAAAIFAAAABHRoaXMFAAAAA2tleQMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAADSW50BAAAAAFiBQAAAAckbWF0Y2gwBQAAAAFiAAAAAAAAAAAABQAAAAN2YWwBAAAADHRyeUdldFN0cmluZwAAAAEAAAADa2V5BAAAAAN2YWwEAAAAByRtYXRjaDAJAAQdAAAAAgUAAAAEdGhpcwUAAAADa2V5AwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAAAZTdHJpbmcEAAAAAWIFAAAAByRtYXRjaDAFAAAAAWICAAAAAAUAAAADdmFsAQAAAAdpc093bmVyAAAAAQAAAAdhZGRyZXNzCQAAAAAAAAIFAAAAB2FkZH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AABWdyb3VwAgAAAAE7BQAAAA1tZW1iZXJBZGRyZXNzBAAAAAlncm91cFNpemUJAQAAAA10cnlHZXRJbnRlZ2VyAAAAAQIAAAASd29ya2luZ19ncm91cF9zaXplBAAAAAxuZXdHcm91cFNpemUJAABkAAAAAgUAAAAJZ3JvdXBTaXplAAAAAAAAAAABCQEAAAAIV3JpdGVTZXQAAAABCQAETAAAAAIJAQAAAAlEYXRhRW50cnkAAAACAgAAABV3b3JraW5nX2dyb3VwX21lbWJlcnMFAAAACG5ld0dyb3VwCQAETAAAAAIJAQAAAAlEYXRhRW50cnkAAAACAgAAABJ3b3JraW5nX2dyb3VwX3NpemUFAAAADG5ld0dyb3VwU2l6ZQkABEwAAAACCQEAAAAJRGF0YUVudHJ5AAAAAgkAASwAAAACCQABLAAAAAICAAAAFXdvcmtpbmdfZ3JvdXBfbWVtYmVyXwUAAAANbWVtYmVyQWRkcmVzcwIAAAAHX3dlaWdodAAAAAAAAAAAAQUAAAADbmlsAAAAAKalTFw=", "height": 1486741, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: none Next: none Full:
Old | New | Differences | |
---|---|---|---|
1 | - | # no script | |
1 | + | {-# STDLIB_VERSION 3 #-} | |
2 | + | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | + | {-# CONTENT_TYPE DAPP #-} | |
4 | + | let mainContract = addressFromStringValue("3N2aG2na6DZtt5Jooq4c9gensYWch4MCSYS") | |
5 | + | ||
6 | + | func tryGetInteger (key) = { | |
7 | + | let val = match getInteger(this, key) { | |
8 | + | case b: Int => | |
9 | + | b | |
10 | + | case _ => | |
11 | + | 0 | |
12 | + | } | |
13 | + | val | |
14 | + | } | |
15 | + | ||
16 | + | ||
17 | + | func tryGetString (key) = { | |
18 | + | let val = match getString(this, key) { | |
19 | + | case b: String => | |
20 | + | b | |
21 | + | case _ => | |
22 | + | "" | |
23 | + | } | |
24 | + | val | |
25 | + | } | |
26 | + | ||
27 | + | ||
28 | + | func isOwner (address) = (address == this) | |
29 | + | ||
30 | + | ||
31 | + | func getGroup () = { | |
32 | + | let val = match getString(this, "working_group_members") { | |
33 | + | case b: String => | |
34 | + | b | |
35 | + | case _ => | |
36 | + | "" | |
37 | + | } | |
38 | + | val | |
39 | + | } | |
40 | + | ||
41 | + | ||
42 | + | func getMembers () = { | |
43 | + | let val = match getString(this, "dao_members") { | |
44 | + | case b: String => | |
45 | + | b | |
46 | + | case _ => | |
47 | + | "" | |
48 | + | } | |
49 | + | val | |
50 | + | } | |
51 | + | ||
52 | + | ||
53 | + | func isGroupMember (a) = (tryGetInteger((("working_group_member_" + toString(a)) + "_weight")) > 0) | |
54 | + | ||
55 | + | ||
56 | + | func canMemberVote (i) = (tryGetInteger((("dao_member_" + toString(i.caller)) + "_weight")) > 0) | |
57 | + | ||
58 | + | ||
59 | + | @Callable(i) | |
60 | + | func addDAOMember (memberAddress) = if (!(isOwner(i.caller))) | |
61 | + | then throw("access only to the DAO owner") | |
62 | + | else if ((tryGetInteger((("dao_member_" + memberAddress) + "_weight")) == 1)) | |
63 | + | then throw("This user already exists") | |
64 | + | else { | |
65 | + | let group = getMembers() | |
66 | + | let newGroup = ((group + ";") + memberAddress) | |
67 | + | let groupSize = tryGetInteger("dao_size") | |
68 | + | let newGroupSize = (groupSize + 1) | |
69 | + | WriteSet([DataEntry("dao_members", newGroup), DataEntry("dao_size", newGroupSize), DataEntry((("dao_member_" + memberAddress) + "_weight"), 1)]) | |
70 | + | } | |
71 | + | ||
72 | + | ||
73 | + | ||
74 | + | @Callable(i) | |
75 | + | func addGroupMember (memberAddress) = if (!(isOwner(i.caller))) | |
76 | + | then throw("access only to the DAO owner") | |
77 | + | else if ((tryGetInteger((("working_group_member_" + memberAddress) + "_weight")) == 1)) | |
78 | + | then throw("This user already exists") | |
79 | + | else { | |
80 | + | let group = getGroup() | |
81 | + | let newGroup = ((group + ";") + memberAddress) | |
82 | + | let groupSize = tryGetInteger("working_group_size") | |
83 | + | let newGroupSize = (groupSize + 1) | |
84 | + | WriteSet([DataEntry("working_group_members", newGroup), DataEntry("working_group_size", newGroupSize), DataEntry((("working_group_member_" + memberAddress) + "_weight"), 1)]) | |
85 | + | } | |
86 | + | ||
87 | + |
github/deemru/w8io/169f3d6 26.66 ms ◑