tx · 8a2RiMTdezb3nFeqn3CoJmhibQ5LRMj89RXbnF1PDPx1

3Ms6Ht5bdVJa6sQnRBUg9nfNpEp7obSad8o:  -0.05000000 Waves

2019.08.12 17:45 [627981] smart account 3Ms6Ht5bdVJa6sQnRBUg9nfNpEp7obSad8o > SELF 0.00000000 Waves

{ "type": 13, "id": "8a2RiMTdezb3nFeqn3CoJmhibQ5LRMj89RXbnF1PDPx1", "fee": 5000000, "feeAssetId": null, "timestamp": 1565621105133, "version": 1, "sender": "3Ms6Ht5bdVJa6sQnRBUg9nfNpEp7obSad8o", "senderPublicKey": "Ebb2ffqL8cMnNmXPNvHLy53xrK7t5WaSFhneCPBSoxop", "proofs": [ "38tPC2NvnovTXpC9EdYhkPGmAAMBwre6nRojPbFgwTANRHDxbjfKYPsLzcbJ8wJ8z1zRkpYmbtwWj7skEa5BGWhr" ], "script": "base64:AAIDAAAAAAAAAAAAAAAhAAAAAAROT05FAgAAAARub25lAQAAAA5nZXROdW1iZXJCeUtleQAAAAEAAAADa2V5BAAAAANudW0EAAAAByRtYXRjaDAJAAQaAAAAAgUAAAAEdGhpcwUAAAADa2V5AwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAAANJbnQEAAAAAWkFAAAAByRtYXRjaDAFAAAAAWkAAAAAAAAAAAAFAAAAA251bQEAAAALZ2V0U3RyQnlLZXkAAAABAAAAA2tleQQAAAADc3RyBAAAAAckbWF0Y2gwCQAEHQAAAAIFAAAABHRoaXMFAAAAA2tleQMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAAGU3RyaW5nBAAAAAFzBQAAAAckbWF0Y2gwBQAAAAFzBQAAAAROT05FBQAAAANzdHIBAAAAD2dldEtleUl0ZW1QcmljZQAAAAEAAAAEaXRlbQkAASwAAAACBQAAAARpdGVtAgAAAAZfcHJpY2UBAAAAEWdldFZhbHVlSXRlbVByaWNlAAAAAQAAAARpdGVtCQEAAAAOZ2V0TnVtYmVyQnlLZXkAAAABCQEAAAAPZ2V0S2V5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PGLQ7jynfqSm8qYppi4tFQ1ph6N6NmghLSsPp7kegr Diff:
OldNewDifferences
106106
107107
108108 func getExtValueItemWhiteListStatus (oracle,account) = {
109- let str = match getString(addressFromStringValue("3MwyDYbjXQ9VRWnPkubmGgypox7663uCLxT"), "3Myck2t9MpHGk7kuytwFRrzbBmm6v5hgZ5x_verifier_status") {
109+ let str = match getString(addressFromStringValue("3MwyDYbjXQ9VRWnPkubmGgypox7663uCLxT"), getExtKeyItemWhiteListStatus(account)) {
110110 case a: String =>
111111 a
112112 case _ =>
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 3 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let NONE = "none"
55
66 func getNumberByKey (key) = {
77 let num = match getInteger(this, key) {
88 case i: Int =>
99 i
1010 case _ =>
1111 0
1212 }
1313 num
1414 }
1515
1616
1717 func getStrByKey (key) = {
1818 let str = match getString(this, key) {
1919 case s: String =>
2020 s
2121 case _ =>
2222 NONE
2323 }
2424 str
2525 }
2626
2727
2828 func getKeyItemPrice (item) = (item + "_price")
2929
3030
3131 func getValueItemPrice (item) = getNumberByKey(getKeyItemPrice(item))
3232
3333
3434 func getKeyUserItemCounter (user,item) = (((item + "_") + user) + "_cnt")
3535
3636
3737 func getValueUserItemCounter (user,item) = getNumberByKey(getKeyUserItemCounter(user, item))
3838
3939
4040 func getKeyItem (supplier,title) = ("item_" + toBase58String(sha256(toBytes((supplier + title)))))
4141
4242
4343 func getKeyItemData (item) = (item + "_data")
4444
4545
4646 func getKeyItemSuplier (item) = (item + "_owner")
4747
4848
4949 func getValueItemSupplier (item) = getStrByKey(getKeyItemSuplier(item))
5050
5151
5252 func getKeyBalanceSupplier (account) = (account + "_balance")
5353
5454
5555 func getValueBalanceSupplier (account) = getNumberByKey(getKeyBalanceSupplier(account))
5656
5757
5858 let VOTERS = 3
5959
6060 let QUORUM = 2
6161
6262 let VOTING = "voting"
6363
6464 let REVEAL = "reveal"
6565
6666 let FEATURED = "featured"
6767
6868 let DELISTED = "delisted"
6969
7070 func getKeyCommit (item,user) = (((item + "_") + user) + "_commit")
7171
7272
7373 func getValueCommit (item,user) = getStrByKey(getKeyCommit(item, user))
7474
7575
7676 func getKeyCommitsCount (item) = (item + "_comcnt")
7777
7878
7979 func getValueCommitsCount (item) = getNumberByKey(getKeyCommitsCount(item))
8080
8181
8282 func getKeyReveal (item,user) = (((item + "_") + user) + "_reveal")
8383
8484
8585 func getValueReveal (item,user) = getStrByKey(getKeyReveal(item, user))
8686
8787
8888 func getKeyItemStatus (item) = (item + "_status")
8989
9090
9191 func getValueItemStatus (item) = getStrByKey(getKeyItemStatus(item))
9292
9393
9494 func getKeyVoteCount (item,vote) = ((item + "_res:") + vote)
9595
9696
9797 func getValueVoteCount (item,vote) = getNumberByKey(getKeyVoteCount(item, vote))
9898
9999
100100 func getExtAddressOracle () = addressFromStringValue("3MwyDYbjXQ9VRWnPkubmGgypox7663uCLxT")
101101
102102
103103 let BLACKLISTED = "blacklisted"
104104
105105 func getExtKeyItemWhiteListStatus (account) = (account + "_verifier_status")
106106
107107
108108 func getExtValueItemWhiteListStatus (oracle,account) = {
109- let str = match getString(addressFromStringValue("3MwyDYbjXQ9VRWnPkubmGgypox7663uCLxT"), "3Myck2t9MpHGk7kuytwFRrzbBmm6v5hgZ5x_verifier_status") {
109+ let str = match getString(addressFromStringValue("3MwyDYbjXQ9VRWnPkubmGgypox7663uCLxT"), getExtKeyItemWhiteListStatus(account)) {
110110 case a: String =>
111111 a
112112 case _ =>
113113 NONE
114114 }
115115 str
116116 }
117117
118118
119119 @Callable(inv)
120120 func addItem (title,price,data) = {
121121 let supplierAddress = toBase58String(inv.caller.bytes)
122122 let item = getKeyItem(supplierAddress, title)
123123 let VARgetExtKeyItemWhiteListStatus = getExtKeyItemWhiteListStatus(supplierAddress)
124124 let VARgetExtAddressOracle = getExtAddressOracle()
125125 let supplierWhiteList = getExtValueItemWhiteListStatus(addressFromStringValue("3MwyDYbjXQ9VRWnPkubmGgypox7663uCLxT"), getExtKeyItemWhiteListStatus(supplierAddress))
126126 throw(("supplierWhiteList: " + supplierWhiteList))
127127 }
128128
129129
130130
131131 @Callable(inv)
132132 func purchase (item) = {
133133 let payment = extract(inv.payment)
134134 if (isDefined(payment.assetId))
135135 then throw("Only payments in WAVES are avalible")
136136 else {
137137 let userAddress = toBase58String(inv.caller.bytes)
138138 let price = getValueItemPrice(item)
139139 let supplierAddress = getValueItemSupplier(item)
140140 if ((price > payment.amount))
141141 then throw("Please send exact coupon price")
142142 else if ((payment.amount > price))
143143 then throw("Please send exact coupon price")
144144 else WriteSet([DataEntry(getKeyUserItemCounter(userAddress, item), (getValueUserItemCounter(userAddress, item) + 1)), DataEntry(getKeyBalanceSupplier(supplierAddress), (getValueBalanceSupplier(supplierAddress) + payment.amount))])
145145 }
146146 }
147147
148148
149149
150150 @Callable(inv)
151151 func withdraw () = {
152152 let supplierAddress = toBase58String(inv.caller.bytes)
153153 let balance = getValueBalanceSupplier(supplierAddress)
154154 if ((0 >= balance))
155155 then throw("Ballance is zero")
156156 else ScriptResult(WriteSet([DataEntry(getKeyBalanceSupplier(supplierAddress), 0)]), TransferSet([ScriptTransfer(addressFromStringValue(supplierAddress), balance, unit)]))
157157 }
158158
159159
160160
161161 @Callable(inv)
162162 func voteCommit (item,hash) = {
163163 let user = toBase58String(inv.caller.bytes)
164164 let commits = getValueCommitsCount(item)
165165 let status = getValueItemStatus(item)
166166 if ((commits >= VOTERS))
167167 then throw("We have reached necessary number of voters")
168168 else if ((getValueCommit(item, user) != NONE))
169169 then throw("User has already voted")
170170 else if ((getKeyItemSuplier(item) == NONE))
171171 then throw("Item does not exist")
172172 else if (if ((status != NONE))
173173 then (status != VOTING)
174174 else false)
175175 then throw("Voting is not possible")
176176 else WriteSet([DataEntry(getKeyCommit(item, user), hash), DataEntry(getKeyCommitsCount(item), (commits + 1)), DataEntry(getKeyItemStatus(item), if ((commits == VOTERS))
177177 then REVEAL
178178 else VOTING)])
179179 }
180180
181181
182182
183183 @Callable(inv)
184184 func revealVotes (item,vote,salt) = {
185185 let user = toBase58String(inv.caller.bytes)
186186 let commits = getValueCommitsCount(item)
187187 let status = getValueItemStatus(item)
188188 let newVoteCount = (getValueVoteCount(item, vote) + 1)
189189 if ((toBase58String(sha256(toBytes((vote + salt)))) != getValueCommit(item, user)))
190190 then throw("Reveal data is not valid")
191191 else if ((VOTERS > getValueCommitsCount(item)))
192192 then throw("Necessary number of voters hasn't reached yet")
193193 else if ((getValueReveal(item, user) != NONE))
194194 then throw("User has already revealed his vote")
195195 else if (if ((status != VOTING))
196196 then (status != REVEAL)
197197 else false)
198198 then throw("Wrong status of vote")
199199 else if (if ((vote != FEATURED))
200200 then (vote != DELISTED)
201201 else false)
202202 then throw("Wrong vote")
203203 else if (if ((status == FEATURED))
204204 then true
205205 else (status == DELISTED))
206206 then throw("Voting complited")
207207 else WriteSet([DataEntry(getKeyReveal(item, user), vote), DataEntry(getKeyVoteCount(item, vote), newVoteCount), DataEntry(getKeyItemStatus(item), if ((newVoteCount >= QUORUM))
208208 then vote
209209 else REVEAL)])
210210 }
211211
212212

github/deemru/w8io/026f985 
33.46 ms