tx · 2tmbwnJ271o7Cut18AddMt17XtSaoLk89DcLpCjS5UQE

3N1dBqKZ7qLA8ECxjJRYmWN32KqoFoUn12E:  -0.01900000 Waves

2021.04.11 00:58 [1476917] smart account 3N1dBqKZ7qLA8ECxjJRYmWN32KqoFoUn12E > SELF 0.00000000 Waves

{ "type": 13, "id": "2tmbwnJ271o7Cut18AddMt17XtSaoLk89DcLpCjS5UQE", "fee": 1900000, "feeAssetId": null, "timestamp": 1618091910652, "version": 2, "chainId": 84, "sender": "3N1dBqKZ7qLA8ECxjJRYmWN32KqoFoUn12E", "senderPublicKey": "Dhmmk8pAab7GjzriTV7Z8MRNtReojzcaSaAXBFpBWYSi", "proofs": [ "4rjRkXyKhvRp3XawcJ81gJ3DTTgBvPdCbbGsSXgmZd2KfkLe68727Kf7FLermGSfb9bZ5XZbH2mnm7zqCSXAKvAj" ], "script": "base64:AAIDAAAAAAAAAAwIARIDCgEIEgMKAQgAAAAIAAAAAAxtYWluQ29udHJhY3QCAAAAIzNNemJ4M3JlYTFzdzhvZHJXaENmOHhKa1Vid0g1cEZCMkZ2AQAAAA10cnlHZXRJbnRlZ2VyAAAAAQAAAANrZXkEAAAAA3ZhbAQAAAAHJG1hdGNoMAkABBoAAAACBQAAAAR0aGlzBQAAAANrZXkDCQAAAQAAAAIFAAAAByRtYXRjaDACAAAAA0ludAQAAAABYgUAAAAHJG1hdGNoMAUAAAABYgAAAAAAAAAAAAUAAAADdmFsAQAAAAx0cnlHZXRTdHJpbmcAAAABAAAAA2tleQQAAAADdmFsBAAAAAckbWF0Y2gwCQAEHQAAAAIFAAAABHRoaXMFAAAAA2tleQMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAAGU3RyaW5nBAAAAAFiBQAAAAckbWF0Y2gwBQAAAAFiAgAAAAAFAAAAA3ZhbAEAAAAHaXNPd25lcgAAAAEAAAAHYWRkcmVzcwkAAAAAAAACBQAAAAdhZGRyZXNzBQAAAAR0aGlzAQAAAAhnZXRHcm91cAAAAA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EAAAANdHJ5R2V0SW50ZWdlcgAAAAECAAAAEndvcmtpbmdfZ3JvdXBfc2l6ZQQAAAAMbmV3R3JvdXBTaXplCQAAZAAAAAIFAAAACWdyb3VwU2l6ZQAAAAAAAAAAAQkBAAAACFdyaXRlU2V0AAAAAQkABEwAAAACCQEAAAAJRGF0YUVudHJ5AAAAAgIAAAAVd29ya2luZ19ncm91cF9tZW1iZXJzBQAAAAhuZXdHcm91cAkABEwAAAACCQEAAAAJRGF0YUVudHJ5AAAAAgIAAAASd29ya2luZ19ncm91cF9zaXplBQAAAAxuZXdHcm91cFNpemUJAARMAAAAAgkBAAAACURhdGFFbnRyeQAAAAIJAAEsAAAAAgkAASwAAAACAgAAABV3b3JraW5nX2dyb3VwX21lbWJlcl8FAAAADW1lbWJlckFkZHJlc3MCAAAAB193ZWlnaHQAAAAAAAAAAAEFAAAAA25pbAAAAAAYhlCl", "height": 1476917, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: none Next: none Full:
OldNewDifferences
1-# no script
1+{-# STDLIB_VERSION 3 #-}
2+{-# SCRIPT_TYPE ACCOUNT #-}
3+{-# CONTENT_TYPE DAPP #-}
4+let mainContract = "3Mzbx3rea1sw8odrWhCf8xJkUbwH5pFB2Fv"
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/026f985 
14.58 ms