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