tx · EJ4gHxD333XTKq6HgkPLh4dea2xP298voC6tDBopeEGU

3N2ewmJdcFYwdM3mPpRapXZ1aaSWTpTGuE5:  -0.10000000 Waves

2021.05.11 18:01 [1521174] smart account 3N2ewmJdcFYwdM3mPpRapXZ1aaSWTpTGuE5 > SELF 0.00000000 Waves

{ "type": 13, "id": "EJ4gHxD333XTKq6HgkPLh4dea2xP298voC6tDBopeEGU", "fee": 10000000, "feeAssetId": null, "timestamp": 1620745347501, "version": 2, "chainId": 84, "sender": "3N2ewmJdcFYwdM3mPpRapXZ1aaSWTpTGuE5", "senderPublicKey": "2icPa3y8k81CaH7dsVJZZjVYGYkD35waVbs6YAzU1oaL", "proofs": [ "3zcZAABukRD4tVA39v8DaSHDsauStTpSmM17qkC179AXPtDNw4VQv8X2w1oXmCVBBMA4ibRcVGC8uYRqrJV5EZis" ], "script": "base64:AAIDAAAAAAAAABcIARIDCgEIEgMKAQgSAwoBCBIECgIICAAAAAYBAAAAB2lzT3duZXIAAAABAAAAB2FkZHJlc3MJAAAAAAAAAgUAAAAHYWRkcmVzcwUAAAAEdGhpcwEAAAANdHJ5R2V0SW50ZWdlcgAAAAEAAAADa2V5BAAAAAN2YWwEAAAAByRtYXRjaDAJAAQaAAAAAgUAAAAEdGhpcwUAAAADa2V5AwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAAANJbnQEAAAAAWIFAAAAByRtYXRjaDAFAAAAAWIAAAAAAAAAAAAFAAAAA3ZhbAEAAAAIZ2V0R3JvdXAAAAAABAAAAAN2YWwEAAAAByRtYXRjaDAJAAQdAAAAAgUAAAAEdGhpcwIAAAAVd29ya2luZ19ncm91cF9tZW1iZXJzAwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAAAZTdHJpbmcEAAAAAWIFAAAAByRtYXRjaDAFAAAAAWICAAAAAAUAAAADdmFsAQAAAA1pc0dyb3VwTWVtYmVyAAAAAQAAAAFhCQAAZgAAAAIJAQAAAA10cnlHZXRJbnRlZ2VyAAAAAQkA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mNhbGxlcgkAAAIAAAABAgAAABhhY2Nlc3Mgb25seSB0byB0aGUgb3duZXIDCQAAAAAAAAIJAQAAAA10cnlHZXRJbnRlZ2VyAAAAAQkAASwAAAACCQABLAAAAAICAAAAFXdvcmtpbmdfZ3JvdXBfbWVtYmVyXwUAAAANbWVtYmVyQWRkcmVzcwIAAAAHX3dlaWdodAAAAAAAAAAAAQkAAAIAAAABAgAAABhUaGlzIHVzZXIgYWxyZWFkeSBleGlzdHMEAAAABWdyb3VwCQEAAAAIZ2V0R3JvdXAAAAAABAAAAAhuZXdHcm91cAkAASwAAAACCQABLAAAAAIFAAAABWdyb3VwAgAAAAE7BQAAAA1tZW1iZXJBZGRyZXNzCQEAAAAIV3JpdGVTZXQAAAABCQAETAAAAAIJAQAAAAlEYXRhRW50cnkAAAACAgAAABV3b3JraW5nX2dyb3VwX21lbWJlcnMFAAAACG5ld0dyb3VwCQAETAAAAAIJAQAAAAlEYXRhRW50cnkAAAACCQABLAAAAAIJAAEsAAAAAgIAAAAVd29ya2luZ19ncm91cF9tZW1iZXJfBQAAAA1tZW1iZXJBZGRyZXNzAgAAAAdfd2VpZ2h0AAAAAAAAAAABBQAAAANuaWwAAAABaQEAAAAQZGVjaXNpb25Pbk1lbWJlcgAAAAIAAAANbWVtYmVyQWRkcmVzcwAAAA1kZWNpc2lvblZhbHVlAwkBAAAAASEAAAABCQEAAAAHaXNPd25lcgAAAAEIBQAAAAFpAAAABmNhbGxlcgkAAAIAAAABAgAAABhhY2Nlc3Mgb25seSB0byB0aGUgb3duZXIJAQAAAAhXcml0ZVNldAAAAAEJAARMAAAAAgkBAAAACURhdGFFbnRyeQAAAAIJAAEsAAAAAgIAAAALZGFvX21lbWJlcl8FAAAADW1lbWJlckFkZHJlc3MJAQAAABBnZXREZWNpc2lvblZhbHVlAAAAAQUAAAANZGVjaXNpb25WYWx1ZQUAAAADbmlsAAAAAAD1sKs=", "height": 1521174, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 4KDDd5S3MytT4T1xu9WTj8YEXNmcouUZPxkbwqb7naad Next: J41wckgn6FnamjafMku7bpqqpp61fCtGmGNfn6mfqbvt Diff:
OldNewDifferences
4747 if (if (!(isGroupMember(i.caller)))
4848 then (tryGetInteger(((caller + "_voted_working_group_members_for_") + memberAddress)) != 1)
4949 else false)
50- then WriteSet([DataEntry(votingKey, votesAmountState), DataEntry(((caller + "_voted_working_group_members_for_") + memberAddress), 1)])
51- else throw("You have no rights or you have already voted")
50+ then if ((tryGetInteger(((caller + "_voted_working_group_members_for_") + memberAddress)) != 1))
51+ then WriteSet([DataEntry(votingKey, votesAmountState), DataEntry(((caller + "_voted_working_group_members_for_") + memberAddress), 1)])
52+ else throw("You have already voted")
53+ else throw("You have no rights")
5254 }
5355
5456
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 3 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 func isOwner (address) = (address == this)
55
66
77 func tryGetInteger (key) = {
88 let val = match getInteger(this, key) {
99 case b: Int =>
1010 b
1111 case _ =>
1212 0
1313 }
1414 val
1515 }
1616
1717
1818 func getGroup () = {
1919 let val = match getString(this, "working_group_members") {
2020 case b: String =>
2121 b
2222 case _ =>
2323 ""
2424 }
2525 val
2626 }
2727
2828
2929 func isGroupMember (a) = (tryGetInteger((("working_group_member_" + toString(a)) + "_weight")) > 0)
3030
3131
3232 func isVoted (a) = (tryGetInteger((("working_group_member_" + toString(a)) + "_weight")) > 0)
3333
3434
3535 func getDecisionValue (d) = if ((d == "rejected"))
3636 then "rejected"
3737 else if ((d == "approved"))
3838 then "approved"
3939 else throw("you need to vote with 'approved' or 'rejected' value")
4040
4141
4242 @Callable(i)
4343 func votesOnMember (memberAddress) = {
4444 let votingKey = (("dao_member_" + memberAddress) + "_voting_state")
4545 let votesAmountState = (tryGetInteger(votingKey) + 1)
4646 let caller = toString(i.caller)
4747 if (if (!(isGroupMember(i.caller)))
4848 then (tryGetInteger(((caller + "_voted_working_group_members_for_") + memberAddress)) != 1)
4949 else false)
50- then WriteSet([DataEntry(votingKey, votesAmountState), DataEntry(((caller + "_voted_working_group_members_for_") + memberAddress), 1)])
51- else throw("You have no rights or you have already voted")
50+ then if ((tryGetInteger(((caller + "_voted_working_group_members_for_") + memberAddress)) != 1))
51+ then WriteSet([DataEntry(votingKey, votesAmountState), DataEntry(((caller + "_voted_working_group_members_for_") + memberAddress), 1)])
52+ else throw("You have already voted")
53+ else throw("You have no rights")
5254 }
5355
5456
5557
5658 @Callable(i)
5759 func proposeMember (memberAddress) = {
5860 let caller = toString(i.caller)
5961 if ((tryGetInteger(("dao_member_" + memberAddress)) == 1))
6062 then throw("This user already exists")
6163 else WriteSet([DataEntry(("dao_member_" + memberAddress), "proposed")])
6264 }
6365
6466
6567
6668 @Callable(i)
6769 func addGroupMember (memberAddress) = if (!(isOwner(i.caller)))
6870 then throw("access only to the owner")
6971 else if ((tryGetInteger((("working_group_member_" + memberAddress) + "_weight")) == 1))
7072 then throw("This user already exists")
7173 else {
7274 let group = getGroup()
7375 let newGroup = ((group + ";") + memberAddress)
7476 WriteSet([DataEntry("working_group_members", newGroup), DataEntry((("working_group_member_" + memberAddress) + "_weight"), 1)])
7577 }
7678
7779
7880
7981 @Callable(i)
8082 func decisionOnMember (memberAddress,decisionValue) = if (!(isOwner(i.caller)))
8183 then throw("access only to the owner")
8284 else WriteSet([DataEntry(("dao_member_" + memberAddress), getDecisionValue(decisionValue))])
8385
8486

github/deemru/w8io/169f3d6 
72.44 ms