tx · J6aReBikuMQU51eqyS9sc32EXjrh7EDhAPNm6pBhDUep 3N7u14dV3tZofRrbRoiHPTCok3V88vKumDS: -0.01000000 Waves 2021.05.21 15:14 [1535424] smart account 3N7u14dV3tZofRrbRoiHPTCok3V88vKumDS > SELF 0.00000000 Waves
{ "type": 13, "id": "J6aReBikuMQU51eqyS9sc32EXjrh7EDhAPNm6pBhDUep", "fee": 1000000, "feeAssetId": null, "timestamp": 1621599271017, "version": 2, "chainId": 84, "sender": "3N7u14dV3tZofRrbRoiHPTCok3V88vKumDS", "senderPublicKey": "GmFdJKQEPLvY6MqtiZyufJUFTUggQZ9QFbTcByaune2D", "proofs": [ "372ZTpy2afFqE2Ymz3vte97eGZZYviM6UhaVv5PEy1nSFZDAto7znrtYKTJPu3Zhvc4TQ62hPAFdAwi142TjzaXD" ], "script": "base64:AAIDAAAAAAAAAAwIARIDCgEIEgMKAQgAAAAHAQAAAA10cnlHZXRJbnRlZ2VyAAAAAQAAAANrZXkEAAAAA3ZhbAQAAAAHJG1hdGNoMAkABBoAAAACBQAAAAR0aGlzBQAAAANrZXkDCQAAAQAAAAIFAAAAByRtYXRjaDACAAAAA0ludAQAAAABYgUAAAAHJG1hdGNoMAUAAAABYgAAAAAAAAAAAAUAAAADdmFsAQAAAAx0cnlHZXRTdHJpbmcAAAABAAAAA2tleQQAAAADdmFsBAAAAAckbWF0Y2gwCQAEHQAAAAIFAAAABHRoaXMFAAAAA2tleQMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAAGU3RyaW5nBAAAAAFiBQAAAAckbWF0Y2gwBQAAAAFiAgAAAAAFAAAAA3ZhbAEAAAAJaXNNYW5hZ2VyAAAAAQAAAAdhZGRyZXNzCQAAAAAAAAIFAAAAB2FkZHJlc3MFAAAABHRoaXMBAAAACGdldEdyb3VwAAAAAAQAAAADdmFsBAAAAAckbWF0Y2gwCQAEHQAAAAIFAAAABHRoaXMCAAAAFXdvcmtpbmdfZ3JvdXBfbWVtYmVycwMJAAABAA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3VwX3NpemUEAAAADG5ld0dyb3VwU2l6ZQkAAGQAAAACBQAAAAlncm91cFNpemUAAAAAAAAAAAEJAQAAAAhXcml0ZVNldAAAAAEJAARMAAAAAgkBAAAACURhdGFFbnRyeQAAAAICAAAAFXdvcmtpbmdfZ3JvdXBfbWVtYmVycwUAAAAIbmV3R3JvdXAJAARMAAAAAgkBAAAACURhdGFFbnRyeQAAAAICAAAAEndvcmtpbmdfZ3JvdXBfc2l6ZQUAAAAMbmV3R3JvdXBTaXplCQAETAAAAAIJAQAAAAlEYXRhRW50cnkAAAACCQABLAAAAAIJAAEsAAAAAgIAAAAVd29ya2luZ19ncm91cF9tZW1iZXJfBQAAAA1tZW1iZXJBZGRyZXNzAgAAAAdfd2VpZ2h0AAAAAAAAAAABBQAAAANuaWwAAAAAkQDfXA==", "height": 1535424, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: none Next: 3gARGVJar2wGuDnn7dkq84ScZtQSAHFRc63XtSGsPPUR 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 isManager (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 (!(isManager(i.caller))) | |
59 | + | then throw("access only to the DAO manager") | |
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 (!(isManager(i.caller))) | |
74 | + | then throw("access only to the DAO manager") | |
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 29.20 ms ◑