tx · C7WcVVowR6tq4aiRVXHGkRjuMDfbqf8DoEQtW6iPDXLF

3N5rNyYSAsaP9QL2eQq286RhevB8msHFffu:  -0.01400000 Waves

2020.09.12 13:58 [1174013] smart account 3N5rNyYSAsaP9QL2eQq286RhevB8msHFffu > SELF 0.00000000 Waves

{ "type": 13, "id": "C7WcVVowR6tq4aiRVXHGkRjuMDfbqf8DoEQtW6iPDXLF", "fee": 1400000, "feeAssetId": null, "timestamp": 1599908385681, "version": 2, "chainId": 84, "sender": "3N5rNyYSAsaP9QL2eQq286RhevB8msHFffu", "senderPublicKey": "CBTEuFN6ku1LNaPuGHHTMh2CBb3kPa5D73XXTJvKydun", "proofs": [ "Jeb4MAFdWfCNiXYNhDywXencgQqvLwMvniUa6co6nAigf7Zb8muJQJAXF2t7mYjJpF8xAReu5qKkhuLKUoJMn7c" ], "script": "base64:AAIDAAAAAAAAACAIARIHCgUICAgICBIECgIICBIDCgEIEgMKAQgSAwoBCAAAAA8AAAAABnVwVm90ZQIAAAAGdXB2b3RlAAAAAA1hZG1pbkFkZHJlc3MxAQAAABoBVDi2IViANlgIPSCUAVQpoGSXhJ2Tw/Y0iwAAAAANYWRtaW5BZGRyZXNzMgEAAAAaAVTlj1A9878YQ058BBZUI9QC+LwgFva37DoAAAAADWFkbWluQWRkcmVzczMBAAAAGgFUrs609CRmf+XvZDjrx5XoefavLLpzyJEYAAAAAAVkeXpJZAEAAAAgfqtB2c5SyrdhjTSeT2NUMvY45D97zjqBcAiarzFPFmsBAAAADWdldFByb2ZpbGVLZXkAAAABAAAAAmlkCQABLAAAAAIFAAAAAmlkAgAAABRfZW50cmVwcmVuZXVyUHJvZmlsZQEAAAAMZ2V0U3RhdHVzS2V5AAAAAQAAAAJpZAkAASwAAAACBQAAAAJpZAIAAAAHX3N0YXR1cwEAAAARZ2V0Vm90ZXJBbW91bnRLZXkAAAACAAAAAmlkAAAABnZvdGVJZAkAASwAAAACCQABLAAAAAIJAAEsAAAAAgUAAAACaWQCAAAA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AAAAV2b3RlcgUAAAAGdm90ZUlkBAAAAA1jdXJyZW50QW1vdW50BAAAAAckbWF0Y2gwCQAEGgAAAAIFAAAABHRoaXMFAAAACmN1cnJlbnRLZXkDCQAAAQAAAAIFAAAAByRtYXRjaDACAAAAA0ludAQAAAABYQUAAAAHJG1hdGNoMAUAAAABYQkAAAIAAAABAgAAACVZb3UgZGlkbid0IHZvdGUgZm9yIHRoaXMgZW50cmVwcmVuZXVyAwkAAAAAAAACBQAAAA1jdXJyZW50QW1vdW50AAAAAAAAAAAACQAAAgAAAAECAAAAJFNlZW1zIHlvdSBoYXZlIHByZXZpb3VzbHkgd2l0aGRyYXduLgkBAAAADFNjcmlwdFJlc3VsdAAAAAIJAQAAAAhXcml0ZVNldAAAAAEJAARMAAAAAgkBAAAACURhdGFFbnRyeQAAAAIFAAAACmN1cnJlbnRLZXkAAAAAAAAAAAAFAAAAA25pbAkBAAAAC1RyYW5zZmVyU2V0AAAAAQkABEwAAAACCQEAAAAOU2NyaXB0VHJhbnNmZXIAAAADCAUAAAABaQAAAAZjYWxsZXIFAAAADWN1cnJlbnRBbW91bnQFAAAABWR5eklkBQAAAANuaWwJAAACAAAAAQIAAAA2Q2FuJ3Qgd2l0aGRyYXcgdm90ZSBhbW91bnQgd2hpbGUgdm90aW5nIGlzIHN0aWxsIG9wZW4uCQAAAgAAAAECAAAAJVlvdSBkaWRuJ3Qgdm90ZSBmb3IgdGhpcyBlbnRyZXByZW5ldXIAAAAAn/u/UQ==", "height": 1174013, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: Eu4ZUxXSzux8gxzQ5NgSd9Q2fsroLQcUNT2UPQ8QUbG4 Next: 8zETtHEGFeQC7sj9BVa8oWJXRAake1TwX9zFQgnECrps Diff:
OldNewDifferences
33 {-# CONTENT_TYPE DAPP #-}
44 let upVote = "upvote"
55
6-let adminAddress = base58'3Mu5woJ54s7vHJgaeNcJ4C9ByfdmMF2jpjC'
6+let adminAddress1 = base58'3Mu5woJ54s7vHJgaeNcJ4C9ByfdmMF2jpjC'
7+
8+let adminAddress2 = base58'3NAqtCScgFynCuRLUoXm2BHTdu8suatCe7b'
9+
10+let adminAddress3 = base58'3N5rNyYSAsaP9QL2eQq286RhevB8msHFffu'
711
812 let dyzId = base58'9XTqBQeJvdMs8VNHv6rXiJLJichg2acG7wCfYcTajQ1G'
913
6569
6670
6771 @Callable(i)
68-func addEntrepreneurProfile (name,avatar,bio,gender,location) = if ((i.caller.bytes != adminAddress))
72+func addEntrepreneurProfile (name,avatar,bio,gender,location) = if (if (if ((i.caller.bytes != adminAddress1))
73+ then true
74+ else (i.caller.bytes != adminAddress2))
75+ then true
76+ else (i.caller.bytes != adminAddress3))
6977 then throw("Only Dyzrupt Admin can call this dApp function")
7078 else {
7179 let transactionId = toBase58String(i.transactionId)
100108
101109
102110 @Callable(i)
103-func openVote (voteId) = if ((i.caller.bytes != adminAddress))
111+func openVote (voteId) = if (if (if ((i.caller.bytes != adminAddress1))
112+ then true
113+ else (i.caller.bytes != adminAddress2))
114+ then true
115+ else (i.caller.bytes != adminAddress3))
104116 then throw("Only Dyzrupt Admin can call this dApp function")
105117 else if (profileExist(voteId))
106118 then WriteSet([DataEntry(getStatusKey(voteId), "open")])
109121
110122
111123 @Callable(i)
112-func closeVote (voteId) = if ((i.caller.bytes != adminAddress))
124+func closeVote (voteId) = if (if (if ((i.caller.bytes != adminAddress1))
125+ then true
126+ else (i.caller.bytes != adminAddress2))
127+ then true
128+ else (i.caller.bytes != adminAddress3))
113129 then throw("Only Dyzrupt Admin can call this dApp function")
114130 else if (profileExist(voteId))
115131 then WriteSet([DataEntry(getStatusKey(voteId), "closed")])
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 3 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let upVote = "upvote"
55
6-let adminAddress = base58'3Mu5woJ54s7vHJgaeNcJ4C9ByfdmMF2jpjC'
6+let adminAddress1 = base58'3Mu5woJ54s7vHJgaeNcJ4C9ByfdmMF2jpjC'
7+
8+let adminAddress2 = base58'3NAqtCScgFynCuRLUoXm2BHTdu8suatCe7b'
9+
10+let adminAddress3 = base58'3N5rNyYSAsaP9QL2eQq286RhevB8msHFffu'
711
812 let dyzId = base58'9XTqBQeJvdMs8VNHv6rXiJLJichg2acG7wCfYcTajQ1G'
913
1014 func getProfileKey (id) = (id + "_entrepreneurProfile")
1115
1216
1317 func getStatusKey (id) = (id + "_status")
1418
1519
1620 func getVoterAmountKey (id,voteId) = (((id + "_") + voteId) + "_amount")
1721
1822
1923 func getVoteKey (id,type) = if ((type == "upvote"))
2024 then (id + "_upvote")
2125 else throw("Invalid vote type")
2226
2327
2428 func profileExist (id) = match getString(this, getProfileKey(id)) {
2529 case a: String =>
2630 true
2731 case _ =>
2832 false
2933 }
3034
3135
3236 func getVoteStatus (voteId) = match getString(this, getStatusKey(voteId)) {
3337 case a: String =>
3438 a
3539 case _ =>
3640 false
3741 }
3842
3943
4044 func getVoteCount (voteId,vote) = match getInteger(this, getVoteKey(voteId, vote)) {
4145 case a: Int =>
4246 a
4347 case _ =>
4448 throw("Not a valid vote ID")
4549 }
4650
4751
4852 func getVoterKey (address,voteId) = ((((address + "_") + voteId) + "_") + "vote")
4953
5054
5155 func getVoter (address,voteId) = match getString(this, getVoterKey(address, voteId)) {
5256 case a: String =>
5357 a
5458 case _ =>
5559 ""
5660 }
5761
5862
5963 func canVote (address,voteId) = {
6064 let voter = getVoter(address, voteId)
6165 if ((voter == ""))
6266 then true
6367 else false
6468 }
6569
6670
6771 @Callable(i)
68-func addEntrepreneurProfile (name,avatar,bio,gender,location) = if ((i.caller.bytes != adminAddress))
72+func addEntrepreneurProfile (name,avatar,bio,gender,location) = if (if (if ((i.caller.bytes != adminAddress1))
73+ then true
74+ else (i.caller.bytes != adminAddress2))
75+ then true
76+ else (i.caller.bytes != adminAddress3))
6977 then throw("Only Dyzrupt Admin can call this dApp function")
7078 else {
7179 let transactionId = toBase58String(i.transactionId)
7280 WriteSet([DataEntry(getProfileKey(transactionId), ((((((((name + "_") + avatar) + "_") + bio) + "_") + gender) + "_") + location)), DataEntry(getVoteKey(transactionId, "upvote"), 0), DataEntry(getStatusKey(transactionId), "open")])
7381 }
7482
7583
7684
7785 @Callable(i)
7886 func vote (voteId,vote) = {
7987 let pmt = extract(i.payment)
8088 let voter = toBase58String(i.caller.bytes)
8189 if ((pmt.amount == 0))
8290 then throw("You cannot vote without paying voting fee")
8391 else if ((pmt.assetId != base58'9XTqBQeJvdMs8VNHv6rXiJLJichg2acG7wCfYcTajQ1G'))
8492 then throw("You can only vote with DYZRUPT token")
8593 else if (canVote(voter, voteId))
8694 then if (profileExist(voteId))
8795 then if ((getVoteStatus(voteId) == "open"))
8896 then if ((vote == upVote))
8997 then {
9098 let voteCount = getVoteCount(voteId, vote)
9199 let newVoteCount = (voteCount + 1)
92100 ScriptResult(WriteSet([DataEntry(getVoteKey(voteId, vote), newVoteCount), DataEntry(getVoterKey(voter, voteId), voteId), DataEntry(getVoterAmountKey(voter, voteId), pmt.amount)]), TransferSet([ScriptTransfer(this, pmt.amount, dyzId)]))
93101 }
94102 else throw("Not a valid vote value")
95103 else throw("This profile is not open for voting")
96104 else throw("Invalid Profile")
97105 else throw("You can't vote twice")
98106 }
99107
100108
101109
102110 @Callable(i)
103-func openVote (voteId) = if ((i.caller.bytes != adminAddress))
111+func openVote (voteId) = if (if (if ((i.caller.bytes != adminAddress1))
112+ then true
113+ else (i.caller.bytes != adminAddress2))
114+ then true
115+ else (i.caller.bytes != adminAddress3))
104116 then throw("Only Dyzrupt Admin can call this dApp function")
105117 else if (profileExist(voteId))
106118 then WriteSet([DataEntry(getStatusKey(voteId), "open")])
107119 else throw("Invalid ID")
108120
109121
110122
111123 @Callable(i)
112-func closeVote (voteId) = if ((i.caller.bytes != adminAddress))
124+func closeVote (voteId) = if (if (if ((i.caller.bytes != adminAddress1))
125+ then true
126+ else (i.caller.bytes != adminAddress2))
127+ then true
128+ else (i.caller.bytes != adminAddress3))
113129 then throw("Only Dyzrupt Admin can call this dApp function")
114130 else if (profileExist(voteId))
115131 then WriteSet([DataEntry(getStatusKey(voteId), "closed")])
116132 else throw("Invalid ID")
117133
118134
119135
120136 @Callable(i)
121137 func withdraw (voteId) = {
122138 let voter = toBase58String(i.caller.bytes)
123139 if ((getVoter(voter, voteId) != ""))
124140 then if ((getVoteStatus(voteId) == "closed"))
125141 then {
126142 let currentKey = getVoterAmountKey(voter, voteId)
127143 let currentAmount = match getInteger(this, currentKey) {
128144 case a: Int =>
129145 a
130146 case _ =>
131147 throw("You didn't vote for this entrepreneur")
132148 }
133149 if ((currentAmount == 0))
134150 then throw("Seems you have previously withdrawn.")
135151 else ScriptResult(WriteSet([DataEntry(currentKey, 0)]), TransferSet([ScriptTransfer(i.caller, currentAmount, dyzId)]))
136152 }
137153 else throw("Can't withdraw vote amount while voting is still open.")
138154 else throw("You didn't vote for this entrepreneur")
139155 }
140156
141157

github/deemru/w8io/026f985 
44.51 ms