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