tx · 5AZ7KJKEmakie8GpoCoLNB3hDNFPHPsJ9ydVKp3c3n4N

3MrqFfv385KAzAqqdQyprR7FMLSapeifggB:  -0.01000000 Waves

2022.11.28 14:22 [2336885] smart account 3MrqFfv385KAzAqqdQyprR7FMLSapeifggB > SELF 0.00000000 Waves

{ "type": 13, "id": "5AZ7KJKEmakie8GpoCoLNB3hDNFPHPsJ9ydVKp3c3n4N", "fee": 1000000, "feeAssetId": null, "timestamp": 1669634565927, "version": 1, "sender": "3MrqFfv385KAzAqqdQyprR7FMLSapeifggB", "senderPublicKey": "8Tqc64F7G2nACr6yk8egBWCVAp9ZLxjTeWYdXoyQvMAN", "proofs": [ "5Mugig6o8vWi4RTxq7uJBcxMK1okuexqyLEP9g4JzrKVyWd5wNm5zFed6gVvFfP1EMGaMn1mAaTj2cTpJarvxULY" ], "script": "base64:BgIlCAISAwoBCBIFCgMIAQESBAoCAQQSAwoBARIDCgEBEgMKAQgSABUAA1NFUAICX18BE2tleU1hbmFnZXJQdWJsaWNLZXkAAhQlc19fbWFuYWdlclB1YmxpY0tleQEaa2V5UGVuZGluZ01hbmFnZXJQdWJsaWNLZXkAAhslc19fcGVuZGluZ01hbmFnZXJQdWJsaWNLZXkBEGJsb2NrSGVpZ2h0RXJyb3IACQACAQIvVGhlIGJsb2NrJ3MgaGVpZ2h0IGlzIHRvbyBiaWcgZm9yIHRoaXMgcHJvcG9zYWwBEGFscmVhZHlWb3RlRXJyb3IACQACAQIWWW91IGhhdmUgYWxyZWFkeSB2b3RlZAELbm9Wb3RlRXJyb3IACQACAQIaWW91IGhhdmUgbm90IGFscmVhZHkgdm90ZWQBEmd3eENvbnRyYWN0QWRkcmVzcwAJALkJAgkAzAgCAgIlcwkAzAgCAhJnd3hDb250cmFjdEFkZHJlc3MFA25pbAUDU0VQAQ9rZXlDdXJyZW50SW5kZXgACQC5CQIJAMwIAgICJXMJAMwIAgIMY3VycmVudEluZGV4BQNuaWwFA1NFUAEWa2V5UHJvcG9zYWxEZ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U1hbmFnZXJQdWJsaWNLZXkACQDYBAEJAQV2YWx1ZQEFAnBtCQDMCAIJAQtEZWxldGVFbnRyeQEJARprZXlQZW5kaW5nTWFuYWdlclB1YmxpY0tleQAFA25pbAkAAgECJFN0cmljdCB2YWx1ZSBpcyBub3QgZXF1YWwgdG8gaXRzZWxmLgkAAgECJFN0cmljdCB2YWx1ZSBpcyBub3QgZXF1YWwgdG8gaXRzZWxmLgECdHgBBnZlcmlmeQAED3RhcmdldFB1YmxpY0tleQQHJG1hdGNoMAkBFm1hbmFnZXJQdWJsaWNLZXlPclVuaXQAAwkAAQIFByRtYXRjaDACCkJ5dGVWZWN0b3IEAnBrBQckbWF0Y2gwBQJwawMJAAECBQckbWF0Y2gwAgRVbml0CAUCdHgPc2VuZGVyUHVibGljS2V5CQACAQILTWF0Y2ggZXJyb3IJAPQDAwgFAnR4CWJvZHlCeXRlcwkAkQMCCAUCdHgGcHJvb2ZzAAAFD3RhcmdldFB1YmxpY0tleVX5V8A=", "chainId": 84, "height": 2336885, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: En37yv1qCQ5tF3qDDjLHwsmmBVzqeKByehiyEJdzUDj2 Next: Deoqy2urwxR5kQ4wv2KdBzu66Mt3t67cXwZWTDyjRdZH Diff:
OldNewDifferences
123123 else alreadyVoteError()]
124124 if ((checks == checks))
125125 then {
126- let gwxNumber = asInt(invoke(value(addressFromString(getStringValue(gwxContractAddress()))), "calcUserGwxAmountAtHeight", [i.caller, getIntegerValue(keyProposalEnd(proposalIndex))], nil))
127- let $t034224003 = if (choice)
126+ let gwxNumber = asInt(invoke(addressFromStringValue(getStringValue(gwxContractAddress())), "calcUserGwxAmountAtHeight", [i.caller, getIntegerValue(keyProposalEnd(proposalIndex))], nil))
127+ let $t034194000 = if (choice)
128128 then {
129129 let action1 = IntegerEntry(keyUserChoice(proposalIndex, toString(i.caller)), 1)
130130 let action2 = IntegerEntry(keyTotalPositiveVoteByProposal(proposalIndex), (getIntegerValue(keyTotalPositiveVoteByProposal(proposalIndex)) + gwxNumber))
135135 let action2 = IntegerEntry(keyTotalNegativeVoteByProposal(proposalIndex), (getIntegerValue(keyTotalNegativeVoteByProposal(proposalIndex)) + gwxNumber))
136136 $Tuple2(action1, action2)
137137 }
138- let action1 = $t034224003._1
139- let action2 = $t034224003._2
138+ let action1 = $t034194000._1
139+ let action2 = $t034194000._2
140140 [IntegerEntry(keyUserNumberVotesGwxInProposal(proposalIndex, toString(i.caller)), gwxNumber), action1, action2]
141141 }
142142 else throw("Strict value is not equal to itself.")
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 6 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let SEP = "__"
55
66 func keyManagerPublicKey () = "%s__managerPublicKey"
77
88
99 func keyPendingManagerPublicKey () = "%s__pendingManagerPublicKey"
1010
1111
1212 func blockHeightError () = throw("The block's height is too big for this proposal")
1313
1414
1515 func alreadyVoteError () = throw("You have already voted")
1616
1717
1818 func noVoteError () = throw("You have not already voted")
1919
2020
2121 func gwxContractAddress () = makeString(["%s", "gwxContractAddress"], SEP)
2222
2323
2424 func keyCurrentIndex () = makeString(["%s", "currentIndex"], SEP)
2525
2626
2727 func keyProposalDescription (number) = makeString(["%s%d", "proposalDescription", toString(number)], SEP)
2828
2929
3030 func keyProposalEnd (number) = makeString(["%s%d", "proposalEnd", toString(number)], SEP)
3131
3232
3333 func keyTotalPositiveVoteByProposal (number) = makeString(["%s%d", "proposalTotalPositiveVoteNumber", toString(number)], SEP)
3434
3535
3636 func keyTotalNegativeVoteByProposal (number) = makeString(["%s%d", "proposalTotalNegativeVoteNumber", toString(number)], SEP)
3737
3838
3939 func keyUserChoice (number,user) = makeString(["%s%d%s", "usersChoicebyProposal", toString(number), user], SEP)
4040
4141
4242 func keyUserNumberVotesGwxInProposal (number,user) = makeString(["%s%d%s", "usersGWXbyProposal", toString(number), user], SEP)
4343
4444
4545 func keyQuorumQuantity (number) = makeString(["%s%d", "quorumQuantity", toString(number)], SEP)
4646
4747
4848 func getCurrentIndex () = getIntegerValue(this, keyCurrentIndex())
4949
5050
5151 func asInt (val) = match val {
5252 case valInt: Int =>
5353 valInt
5454 case _ =>
5555 throw("fail to cast into Int")
5656 }
5757
5858
5959 func managerPublicKeyOrUnit () = match getString(keyManagerPublicKey()) {
6060 case s: String =>
6161 fromBase58String(s)
6262 case _: Unit =>
6363 unit
6464 case _ =>
6565 throw("Match error")
6666 }
6767
6868
6969 func pendingManagerPublicKeyOrUnit () = match getString(keyPendingManagerPublicKey()) {
7070 case s: String =>
7171 fromBase58String(s)
7272 case _: Unit =>
7373 unit
7474 case _ =>
7575 throw("Match error")
7676 }
7777
7878
7979 func isManager (i) = match managerPublicKeyOrUnit() {
8080 case pk: ByteVector =>
8181 (i.callerPublicKey == pk)
8282 case _: Unit =>
8383 (i.caller == this)
8484 case _ =>
8585 throw("Match error")
8686 }
8787
8888
8989 func mustManager (i) = if (isManager(i))
9090 then true
9191 else throw("permission denied")
9292
9393
9494 @Callable(i)
9595 func constructor (gwxContractAddress) = {
9696 let check = mustManager(i)
9797 if ((check == check))
9898 then [StringEntry(gwxContractAddress(), gwxContractAddress), IntegerEntry(keyCurrentIndex(), 0)]
9999 else throw("Strict value is not equal to itself.")
100100 }
101101
102102
103103
104104 @Callable(i)
105105 func startNewVote (description,expirationHeight,quorumNumber) = {
106106 let checks = [mustManager(i)]
107107 if ((checks == checks))
108108 then {
109109 let theIndex = getCurrentIndex()
110110 [IntegerEntry(keyCurrentIndex(), (theIndex + 1)), StringEntry(keyProposalDescription(theIndex), description), IntegerEntry(keyProposalEnd(theIndex), (lastBlock.height + expirationHeight)), IntegerEntry(keyTotalPositiveVoteByProposal(theIndex), 0), IntegerEntry(keyTotalNegativeVoteByProposal(theIndex), 0), IntegerEntry(keyQuorumQuantity(theIndex), quorumNumber)]
111111 }
112112 else throw("Strict value is not equal to itself.")
113113 }
114114
115115
116116
117117 @Callable(i)
118118 func voteFor (proposalIndex,choice) = {
119119 let checks = [if ((getIntegerValue(this, keyProposalEnd(proposalIndex)) > lastBlock.height))
120120 then true
121121 else blockHeightError(), if ((getString(this, keyUserNumberVotesGwxInProposal(proposalIndex, toString(i.caller))) == unit))
122122 then true
123123 else alreadyVoteError()]
124124 if ((checks == checks))
125125 then {
126- let gwxNumber = asInt(invoke(value(addressFromString(getStringValue(gwxContractAddress()))), "calcUserGwxAmountAtHeight", [i.caller, getIntegerValue(keyProposalEnd(proposalIndex))], nil))
127- let $t034224003 = if (choice)
126+ let gwxNumber = asInt(invoke(addressFromStringValue(getStringValue(gwxContractAddress())), "calcUserGwxAmountAtHeight", [i.caller, getIntegerValue(keyProposalEnd(proposalIndex))], nil))
127+ let $t034194000 = if (choice)
128128 then {
129129 let action1 = IntegerEntry(keyUserChoice(proposalIndex, toString(i.caller)), 1)
130130 let action2 = IntegerEntry(keyTotalPositiveVoteByProposal(proposalIndex), (getIntegerValue(keyTotalPositiveVoteByProposal(proposalIndex)) + gwxNumber))
131131 $Tuple2(action1, action2)
132132 }
133133 else {
134134 let action1 = IntegerEntry(keyUserChoice(proposalIndex, toString(i.caller)), 0)
135135 let action2 = IntegerEntry(keyTotalNegativeVoteByProposal(proposalIndex), (getIntegerValue(keyTotalNegativeVoteByProposal(proposalIndex)) + gwxNumber))
136136 $Tuple2(action1, action2)
137137 }
138- let action1 = $t034224003._1
139- let action2 = $t034224003._2
138+ let action1 = $t034194000._1
139+ let action2 = $t034194000._2
140140 [IntegerEntry(keyUserNumberVotesGwxInProposal(proposalIndex, toString(i.caller)), gwxNumber), action1, action2]
141141 }
142142 else throw("Strict value is not equal to itself.")
143143 }
144144
145145
146146
147147 @Callable(i)
148148 func deleteVote (proposalIndex) = {
149149 let checks = [if ((getIntegerValue(this, keyProposalEnd(proposalIndex)) > lastBlock.height))
150150 then true
151151 else blockHeightError(), if ((getInteger(keyUserNumberVotesGwxInProposal(proposalIndex, toString(i.caller))) != unit))
152152 then true
153153 else noVoteError()]
154154 if ((checks == checks))
155155 then {
156156 let action = if ((getIntegerValue(keyUserChoice(proposalIndex, toString(i.caller))) == 1))
157157 then IntegerEntry(keyTotalPositiveVoteByProposal(proposalIndex), (getIntegerValue(keyTotalPositiveVoteByProposal(proposalIndex)) - getIntegerValue(keyUserNumberVotesGwxInProposal(proposalIndex, toString(i.caller)))))
158158 else IntegerEntry(keyTotalNegativeVoteByProposal(proposalIndex), (getIntegerValue(keyTotalNegativeVoteByProposal(proposalIndex)) - getIntegerValue(keyUserNumberVotesGwxInProposal(proposalIndex, toString(i.caller)))))
159159 [action, DeleteEntry(keyUserNumberVotesGwxInProposal(proposalIndex, toString(i.caller))), DeleteEntry(keyUserChoice(proposalIndex, toString(i.caller)))]
160160 }
161161 else throw("Strict value is not equal to itself.")
162162 }
163163
164164
165165
166166 @Callable(i)
167167 func getResultREADONLY (proposalIndex) = {
168168 let positiveVotes = getIntegerValue(keyTotalPositiveVoteByProposal(proposalIndex))
169169 let negativeVotes = getIntegerValue(keyTotalNegativeVoteByProposal(proposalIndex))
170170 let quorumNumber = getIntegerValue(keyQuorumQuantity(proposalIndex))
171171 $Tuple2(nil, [positiveVotes, negativeVotes, quorumNumber])
172172 }
173173
174174
175175
176176 @Callable(i)
177177 func setManager (pendingManagerPublicKey) = {
178178 let checkCaller = mustManager(i)
179179 if ((checkCaller == checkCaller))
180180 then {
181181 let checkManagerPublicKey = fromBase58String(pendingManagerPublicKey)
182182 if ((checkManagerPublicKey == checkManagerPublicKey))
183183 then [StringEntry(keyPendingManagerPublicKey(), pendingManagerPublicKey)]
184184 else throw("Strict value is not equal to itself.")
185185 }
186186 else throw("Strict value is not equal to itself.")
187187 }
188188
189189
190190
191191 @Callable(i)
192192 func confirmManager () = {
193193 let pm = pendingManagerPublicKeyOrUnit()
194194 let hasPM = if (isDefined(pm))
195195 then true
196196 else throw("no pending manager")
197197 if ((hasPM == hasPM))
198198 then {
199199 let checkPM = if ((i.callerPublicKey == value(pm)))
200200 then true
201201 else throw("you are not pending manager")
202202 if ((checkPM == checkPM))
203203 then [StringEntry(keyManagerPublicKey(), toBase58String(value(pm))), DeleteEntry(keyPendingManagerPublicKey())]
204204 else throw("Strict value is not equal to itself.")
205205 }
206206 else throw("Strict value is not equal to itself.")
207207 }
208208
209209
210210 @Verifier(tx)
211211 func verify () = {
212212 let targetPublicKey = match managerPublicKeyOrUnit() {
213213 case pk: ByteVector =>
214214 pk
215215 case _: Unit =>
216216 tx.senderPublicKey
217217 case _ =>
218218 throw("Match error")
219219 }
220220 sigVerify(tx.bodyBytes, tx.proofs[0], targetPublicKey)
221221 }
222222

github/deemru/w8io/026f985 
51.86 ms