tx · G1cQvyASiH1oJeHT6wACYjaG6epz6QvSStuxWnxq5SXQ

3NASTFHC1YtW7GLjJc29iqiECnSnqeTA3Ry:  -0.10000000 Waves

2021.05.11 17:42 [1521153] smart account 3NASTFHC1YtW7GLjJc29iqiECnSnqeTA3Ry > SELF 0.00000000 Waves

{ "type": 13, "id": "G1cQvyASiH1oJeHT6wACYjaG6epz6QvSStuxWnxq5SXQ", "fee": 10000000, "feeAssetId": null, "timestamp": 1620744142364, "version": 2, "chainId": 84, "sender": "3NASTFHC1YtW7GLjJc29iqiECnSnqeTA3Ry", "senderPublicKey": "3nb9JsU2MgGoFtV4Rfm9aMbNRLr8hM9YJ6heMENC8hon", "proofs": [ "KUrPP8h563yuShvwCSb284HQA2KyTQpvJUX4WSD9hSHQUWeX7rARhoU759tYHELY6FQb4zgC3TzKeHpUTDFdxrq" ], "script": "base64:AAIDAAAAAAAAABcIARIDCgEIEgMKAQgSAwoBCBIECgIICAAAAAYBAAAAB2lzT3duZXIAAAABAAAAB2FkZHJlc3MJAAAAAAAAAgUAAAAHYWRkcmVzcwUAAAAEdGhpcwEAAAANdHJ5R2V0SW50ZWdlcgAAAAEAAAADa2V5BAAAAAN2YWwEAAAAByRtYXRjaDAJAAQaAAAAAgUAAAAEdGhpcwUAAAADa2V5AwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAAANJbnQEAAAAAWIFAAAAByRtYXRjaDAFAAAAAWIAAAAAAAAAAAAFAAAAA3ZhbAEAAAAIZ2V0R3JvdXAAAAAABAAAAAN2YWwEAAAAByRtYXRjaDAJAAQdAAAAAgUAAAAEdGhpcwIAAAAVd29ya2luZ19ncm91cF9tZW1iZXJzAwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAAAZTdHJpbmcEAAAAAWIFAAAAByRtYXRjaDAFAAAAAWICAAAAAAUAAAADdmFsAQAAAA1pc0dyb3VwTWVtYmVyAAAAAQAAAAFhCQAAZgAAAAIJAQAAAA10cnlHZXRJbnRlZ2VyAAAAAQk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ZWlnaHQAAAAAAAAAAAEJAAACAAAAAQIAAAAYVGhpcyB1c2VyIGFscmVhZHkgZXhpc3RzBAAAAAVncm91cAkBAAAACGdldEdyb3VwAAAAAAQAAAAIbmV3R3JvdXAJAAEsAAAAAgkAASwAAAACBQAAAAVncm91cAIAAAABOwUAAAANbWVtYmVyQWRkcmVzcwkBAAAACFdyaXRlU2V0AAAAAQkABEwAAAACCQEAAAAJRGF0YUVudHJ5AAAAAgIAAAAVd29ya2luZ19ncm91cF9tZW1iZXJzBQAAAAhuZXdHcm91cAkABEwAAAACCQEAAAAJRGF0YUVudHJ5AAAAAgkAASwAAAACCQABLAAAAAICAAAAFXdvcmtpbmdfZ3JvdXBfbWVtYmVyXwUAAAANbWVtYmVyQWRkcmVzcwIAAAAHX3dlaWdodAAAAAAAAAAAAQUAAAADbmlsAAAAAWkBAAAAEGRlY2lzaW9uT25NZW1iZXIAAAACAAAADW1lbWJlckFkZHJlc3MAAAANZGVjaXNpb25WYWx1ZQMJAQAAAAEhAAAAAQkBAAAAB2lzT3duZXIAAAABCAUAAAABaQAAAAZjYWxsZXIJAAACAAAAAQIAAAAYYWNjZXNzIG9ubHkgdG8gdGhlIG93bmVyCQEAAAAIV3JpdGVTZXQAAAABCQAETAAAAAIJAQAAAAlEYXRhRW50cnkAAAACCQABLAAAAAICAAAAC2Rhb19tZW1iZXJfBQAAAA1tZW1iZXJBZGRyZXNzCQEAAAAQZ2V0RGVjaXNpb25WYWx1ZQAAAAEFAAAADWRlY2lzaW9uVmFsdWUFAAAAA25pbAAAAABaP+3T", "height": 1521153, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: shQnctf2SZM4v4DR3auKUetjKZcQpvoY6DRj61KUhic Next: none Full:
OldNewDifferences
11 {-# STDLIB_VERSION 3 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
4-func a (b) = {
5- let c = {
6- let d = getInteger(this, b)
7- if ($isInstanceOf(d, "Int"))
4+func a (b) = (b == this)
5+
6+
7+func c (d) = {
8+ let e = {
9+ let f = getInteger(this, d)
10+ if ($isInstanceOf(f, "Int"))
811 then {
9- let e = d
10- e
12+ let g = f
13+ g
1114 }
1215 else 0
1316 }
14- c
17+ e
1518 }
1619
1720
18-func f (b) = {
19- let c = {
20- let d = getString(this, b)
21- if ($isInstanceOf(d, "String"))
21+func h () = {
22+ let e = {
23+ let f = getString(this, "working_group_members")
24+ if ($isInstanceOf(f, "String"))
2225 then {
23- let e = d
24- e
26+ let g = f
27+ g
2528 }
2629 else ""
2730 }
28- c
31+ e
2932 }
3033
3134
32-func g (h) = (h == this)
35+func i (j) = (c((("working_group_member_" + toString(j)) + "_weight")) > 0)
3336
3437
35-func i () = {
36- let c = {
37- let d = getString(this, "working_group_members")
38- if ($isInstanceOf(d, "String"))
39- then {
40- let e = d
41- e
42- }
43- else ""
44- }
45- c
38+func k (j) = (c((("working_group_member_" + toString(j)) + "_weight")) > 0)
39+
40+
41+func l (m) = if ((m == "rejected"))
42+ then "rejected"
43+ else if ((m == "approved"))
44+ then "approved"
45+ else throw("you need to vote with 'approved' or 'rejected' value")
46+
47+
48+@Callable(n)
49+func votesOnMember (o) = {
50+ let p = (("dao_member_" + o) + "_voting_state")
51+ let q = (c(p) + 1)
52+ let r = toString(n.caller)
53+ if (if (!(i(n.caller)))
54+ then (c(((r + "_voted_working_group_members_for_") + o)) != 1)
55+ else false)
56+ then WriteSet([DataEntry(p, q), DataEntry(((r + "_voted_working_group_members_for_") + o), 1)])
57+ else throw("You have no rights or you have already voted")
4658 }
4759
4860
49-func j () = {
50- let c = {
51- let d = getString(this, "dao_members")
52- if ($isInstanceOf(d, "String"))
53- then {
54- let e = d
55- e
56- }
57- else ""
58- }
59- c
61+
62+@Callable(n)
63+func proposeMember (o) = {
64+ let r = toString(n.caller)
65+ if ((c(("dao_member_" + o)) == 1))
66+ then throw("This user already exists")
67+ else WriteSet([DataEntry(("dao_member_" + o), "proposed")])
6068 }
6169
6270
63-func k (l) = (a((("working_group_member_" + toString(l)) + "_weight")) > 0)
64-
65-
66-func m (n) = (a((("dao_member_" + toString(n.caller)) + "_weight")) > 0)
67-
6871
6972 @Callable(n)
70-func addDAOMember (o) = if (!(g(n.caller)))
71- then throw("access only to the DAO owner")
72- else if ((a((("dao_member_" + o) + "_weight")) == 1))
73+func addGroupMember (o) = if (!(a(n.caller)))
74+ then throw("access only to the owner")
75+ else if ((c((("working_group_member_" + o) + "_weight")) == 1))
7376 then throw("This user already exists")
7477 else {
75- let p = j()
76- let q = ((p + ";") + o)
77- let r = a("dao_size")
78- let s = (r + 1)
79- WriteSet([DataEntry("dao_members", q), DataEntry("dao_size", s), DataEntry((("dao_member_" + o) + "_weight"), 1)])
78+ let s = h()
79+ let t = ((s + ";") + o)
80+ WriteSet([DataEntry("working_group_members", t), DataEntry((("working_group_member_" + o) + "_weight"), 1)])
8081 }
8182
8283
8384
8485 @Callable(n)
85-func addGroupMember (o) = if (!(g(n.caller)))
86- then throw("access only to the DAO owner")
87- else if ((a((("working_group_member_" + o) + "_weight")) == 1))
88- then throw("This user already exists")
89- else {
90- let p = i()
91- let q = ((p + ";") + o)
92- let r = a("working_group_size")
93- let s = (r + 1)
94- WriteSet([DataEntry("working_group_members", q), DataEntry("working_group_size", s), DataEntry((("working_group_member_" + o) + "_weight"), 1)])
95- }
86+func decisionOnMember (o,u) = if (!(a(n.caller)))
87+ then throw("access only to the owner")
88+ else WriteSet([DataEntry(("dao_member_" + o), l(u))])
9689
9790

github/deemru/w8io/169f3d6 
41.64 ms