tx · 9JzJwnyUo1ZnNyQixAzRM5UEVBbuL6sFvTuahKB1Q3pf

3N9CYzYafsvnHJ98ckYEnUHM1gCNwg23Nne:  -0.01900000 Waves

2021.04.09 00:03 [1473990] smart account 3N9CYzYafsvnHJ98ckYEnUHM1gCNwg23Nne > SELF 0.00000000 Waves

{ "type": 13, "id": "9JzJwnyUo1ZnNyQixAzRM5UEVBbuL6sFvTuahKB1Q3pf", "fee": 1900000, "feeAssetId": null, "timestamp": 1617915838132, "version": 2, "chainId": 84, "sender": "3N9CYzYafsvnHJ98ckYEnUHM1gCNwg23Nne", "senderPublicKey": "4kXVafaQd6RW8GSBj4f567t6zXXvqJBJjfz3VraNGmV6", "proofs": [ "pGAkPs44VBzm9GLbB7ZH7Kefqd1xjkz2zaFLYNVPcDJP4eXbSDvGbJNhzXVrZQ9ig71rBo5DMkmKCEqWSKZg22B" ], "script": "base64:AAIDAAAAAAAAAAwIARIDCgEIEgMKAQgAAAAHAQAAAA10cnlHZXRJbnRlZ2VyAAAAAQAAAANrZXkEAAAAA3ZhbAQAAAAHJG1hdGNoMAkABBoAAAACBQAAAAR0aGlzBQAAAANrZXkDCQAAAQAAAAIFAAAAByRtYXRjaDACAAAAA0ludAQAAAABYgUAAAAHJG1hdGNoMAUAAAABYgAAAAAAAAAAAAUAAAADdmFsAQAAAAx0cnlHZXRTdHJpbmcAAAABAAAAA2tleQQAAAADdmFsBAAAAAckbWF0Y2gwCQAEHQAAAAIFAAAABHRoaXMFAAAAA2tleQMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAAGU3RyaW5nBAAAAAFiBQAAAAckbWF0Y2gwBQAAAAFiAgAAAAAFAAAAA3ZhbAEAAAAHaXNPd25lcgAAAAEAAAAHYWRkcmVzcwkAAAAAAAACBQAAAAdhZGRyZXNzBQAAAAR0aGlzAQAAAAhnZXRHcm91cAAAAAAEAAAAA3ZhbAQAAAAHJG1hdGNoMAkABB0AAAACBQAAAAR0aGlzAgAAABV3b3JraW5nX2dyb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V3R3JvdXBTaXplCQAAZAAAAAIFAAAACWdyb3VwU2l6ZQAAAAAAAAAAAQkBAAAACFdyaXRlU2V0AAAAAQkABEwAAAACCQEAAAAJRGF0YUVudHJ5AAAAAgIAAAAVd29ya2luZ19ncm91cF9tZW1iZXJzBQAAAAhuZXdHcm91cAkABEwAAAACCQEAAAAJRGF0YUVudHJ5AAAAAgIAAAASd29ya2luZ19ncm91cF9zaXplBQAAAAxuZXdHcm91cFNpemUJAARMAAAAAgkBAAAACURhdGFFbnRyeQAAAAIJAAEsAAAAAgkAASwAAAACAgAAABV3b3JraW5nX2dyb3VwX21lbWJlcl8FAAAADW1lbWJlckFkZHJlc3MCAAAAB193ZWlnaHQAAAAAAAAAAAEFAAAAA25pbAAAAAC0Ay8t", "height": 1473990, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 5KHxkQph73sV58Pe3hNMWjCvpeQSjP74dYT8HUkK23kE Next: AbgMf8bjskKGYh2LKqsfXFmYz6WJe9tHH1abPDhSrUAU Full:
OldNewDifferences
11 {-# STDLIB_VERSION 3 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 func tryGetInteger (key) = {
55 let val = match getInteger(this, key) {
66 case b: Int =>
77 b
88 case _ =>
99 0
1010 }
1111 val
1212 }
1313
1414
1515 func tryGetString (key) = {
1616 let val = match getString(this, key) {
1717 case b: String =>
1818 b
1919 case _ =>
2020 ""
2121 }
2222 val
2323 }
2424
2525
2626 func isOwner (address) = (address == this)
2727
2828
2929 func getGroup () = {
3030 let val = match getString(this, "working_group_members") {
3131 case b: String =>
3232 b
3333 case _ =>
3434 ""
3535 }
3636 val
3737 }
3838
3939
4040 func getMembers () = {
4141 let val = match getString(this, "dao_members") {
4242 case b: String =>
4343 b
4444 case _ =>
4545 ""
4646 }
4747 val
4848 }
4949
5050
5151 func isGroupMember (a) = (tryGetInteger((("working_group_member_" + toString(a)) + "_weight")) > 0)
5252
5353
5454 func canMemberVote (i) = (tryGetInteger((("dao_member_" + toString(i.caller)) + "_weight")) > 0)
5555
5656
5757 @Callable(i)
5858 func addDAOMember (memberAddress) = if (!(isOwner(i.caller)))
5959 then throw("access only to the DAO owner")
6060 else if ((tryGetInteger((("dao_member_" + memberAddress) + "_weight")) == 1))
6161 then throw("This user already exists")
6262 else {
6363 let group = getMembers()
6464 let newGroup = ((group + ";") + memberAddress)
6565 let groupSize = tryGetInteger("dao_size")
6666 let newGroupSize = (groupSize + 1)
6767 WriteSet([DataEntry("dao_members", newGroup), DataEntry("dao_size", newGroupSize), DataEntry((("dao_member_" + memberAddress) + "_weight"), 1)])
6868 }
6969
7070
7171
7272 @Callable(i)
7373 func addGroupMember (memberAddress) = if (!(isOwner(i.caller)))
7474 then throw("access only to the DAO owner")
7575 else if ((tryGetInteger((("working_group_member_" + memberAddress) + "_weight")) == 1))
7676 then throw("This user already exists")
7777 else {
7878 let group = getGroup()
7979 let newGroup = ((group + ";") + memberAddress)
8080 let groupSize = tryGetInteger("working_group_size")
8181 let newGroupSize = (groupSize + 1)
8282 WriteSet([DataEntry("working_group_members", newGroup), DataEntry("working_group_size", newGroupSize), DataEntry((("working_group_member_" + memberAddress) + "_weight"), 1)])
8383 }
8484
8585

github/deemru/w8io/169f3d6 
23.78 ms