tx · HL1JWwebVDzowEywmMAPjvXLQpZqBUZH5nbHTPKpCtbN

3N1PfpVubU6fVmRVRGFNArEvahccMSUDRn7:  -0.01200000 Waves

2022.07.08 14:27 [2130665] smart account 3N1PfpVubU6fVmRVRGFNArEvahccMSUDRn7 > SELF 0.00000000 Waves

{ "type": 13, "id": "HL1JWwebVDzowEywmMAPjvXLQpZqBUZH5nbHTPKpCtbN", "fee": 1200000, "feeAssetId": null, "timestamp": 1657279696550, "version": 2, "chainId": 84, "sender": "3N1PfpVubU6fVmRVRGFNArEvahccMSUDRn7", "senderPublicKey": "FNbeUwB5m7fPoMsYP71MfhN7orLRD9v3RhP3HeYjw92n", "proofs": [ "3BTSYTh7bKp6vtsC2tK6czckumJ1NbKNm9n9ovnTcF3WsshwzE4dRDcuXDSM5cC4VBZmhurkNDcAWhHc4kX7yQ8G" ], "script": "base64:AAIFAAAAAAAAACUIAhIDCgEIEgUKAwgIARIDCgEIEgASBAoCCAESAwoBCBIDCgEIAAAAGAAAAAAHdG9rZW5JZAEAAAAFZP9n63sAAAAACm11bHRpcGxpZXIAAAAAAAAAAAoAAAAAD2Ftb3VudEdldFRva2VucwAAAAAAAA9CQAAAAAAJc2VwYXJhdG9yAgAAAAFfAQAAAA9nZXRXaGl0ZUxpc3RLZXkAAAABAAAABGFkZHIJAAS5AAAAAgkABEwAAAACAgAAAAJ3bAkABEwAAAACBQAAAARhZGRyBQAAAANuaWwFAAAACXNlcGFyYXRvcgEAAAARZ2V0V2hpdGVMaXN0VmFsdWUAAAABAAAABGFkZHIJAQAAABFAZXh0ck5hdGl2ZSgxMDUxKQAAAAIFAAAABHRoaXMJAQAAAA9nZXRXaGl0ZUxpc3RLZXkAAAABBQAAAARhZGRyAQAAAA9nZXRCbGFja0xpc3RLZXkAAAABAAAABGFkZHIJAAS5AAAAAgkABEwAAAACAgAAAAJibAkABEwAAAACBQAAAARhZGRyBQAAAANuaWwFAAAACXNlcGFyYXRvcgEAAAARZ2V0QmxhY2tMaXN0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AAAA5nZXRJdGVtU29sZEtleQAAAAEFAAAABml0ZW1JZAkABCUAAAABCAUAAAABaQAAAAZjYWxsZXIFAAAAA25pbAkAAAIAAAABAgAAABVXcm9uZyBwYXltZW50IGFzc2V0SWQJAAACAAAAAQIAAAAVQ2FsbGVyIGZyb20gYmxhY2tMaXN0AAAAAQAAAAJ0eAEAAAAGdmVyaWZ5AAAAAAQAAAAHJG1hdGNoMAUAAAACdHgDCQAAAQAAAAIFAAAAByRtYXRjaDACAAAAD0RhdGFUcmFuc2FjdGlvbgQAAAADZHR4BQAAAAckbWF0Y2gwAwkBAAAAASEAAAABCQEAAAAJaXNEZWZpbmVkAAAAAQkABBMAAAACCAUAAAADZHR4AAAABGRhdGECAAAABWFkbWluCQAB9AAAAAMIBQAAAAJ0eAAAAAlib2R5Qnl0ZXMJAAGRAAAAAggFAAAAAnR4AAAABnByb29mcwAAAAAAAAAAAAkAAlkAAAABCQEAAAARQGV4dHJOYXRpdmUoMTA1MykAAAACBQAAAAR0aGlzAgAAAAVhZG1pbgcDCQAAAQAAAAIFAAAAByRtYXRjaDACAAAAF01hc3NUcmFuc2ZlclRyYW5zYWN0aW9uBAAAAANtdHgFAAAAByRtYXRjaDAJAAH0AAAAAwgFAAAAAnR4AAAACWJvZHlCeXRlcwkAAZEAAAACCAUAAAACdHgAAAAGcHJvb2ZzAAAAAAAAAAAACQACWQAAAAEJAQAAABFAZXh0ck5hdGl2ZSgxMDUzKQAAAAIFAAAABHRoaXMCAAAABWFkbWluCQAB9AAAAAMIBQAAAAJ0eAAAAAlib2R5Qnl0ZXMJAAGRAAAAAggFAAAAAnR4AAAABnByb29mcwAAAAAAAAAAAAgFAAAAAnR4AAAAD3NlbmRlclB1YmxpY0tleVtqY/c=", "height": 2130665, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: none Next: 2cNNxQgszSgRouWynfiLJex1tE67Lx9QVu5MfyDW6xuc Full:
OldNewDifferences
1-# no script
1+{-# STDLIB_VERSION 5 #-}
2+{-# SCRIPT_TYPE ACCOUNT #-}
3+{-# CONTENT_TYPE DAPP #-}
4+let tokenId = base58'CPtoken'
5+
6+let multiplier = 10
7+
8+let amountGetTokens = 1000000
9+
10+let separator = "_"
11+
12+func getWhiteListKey (addr) = makeString(["wl", addr], separator)
13+
14+
15+func getWhiteListValue (addr) = getBooleanValue(this, getWhiteListKey(addr))
16+
17+
18+func getBlackListKey (addr) = makeString(["bl", addr], separator)
19+
20+
21+func getBlackListValue (addr) = valueOrElse(getBoolean(this, getBlackListKey(addr)), false)
22+
23+
24+func getTicketKey (addr) = makeString(["ticket", addr], separator)
25+
26+
27+func getTicketValue (addr) = getBinaryValue(this, getTicketKey(addr))
28+
29+
30+func getItemPriceKey (itemId) = makeString(["item", itemId], separator)
31+
32+
33+func getItemPriceValue (itemId) = getIntegerValue(this, getItemPriceKey(itemId))
34+
35+
36+func getVotingDetailsKey (votingId) = makeString(["votingDetails", votingId], separator)
37+
38+
39+func getItemSoldKey (itemId) = makeString(["sold", "item", itemId], separator)
40+
41+
42+func getVotingEndKey (votingId) = makeString(["votingEnd", votingId], separator)
43+
44+
45+func getVotingEndValue (votingId) = getIntegerValue(this, getVotingEndKey(votingId))
46+
47+
48+func getVotingVariantKey (votingId,variant) = makeString(["votingId", votingId, "variant", toString(variant)], separator)
49+
50+
51+func getVotingVariantValue (votingId,variant) = getIntegerValue(this, getVotingVariantKey(votingId, variant))
52+
53+
54+func getVoterKey (votingId,voterAddr) = makeString(["votingId", votingId, voterAddr], separator)
55+
56+
57+func isAdmin (sender) = {
58+ let admin = getString(this, "admin")
59+ if (!(isDefined(admin)))
60+ then throw("init first")
61+ else (addressFromPublicKey(fromBase58String(value(admin))) == sender)
62+ }
63+
64+
65+func isEndOfVoting (votingId) = {
66+ let now = value(blockInfoByHeight(height)).timestamp
67+ let end = getVotingEndValue(votingId)
68+ (now >= end)
69+ }
70+
71+
72+func isCorrectVoter (votingId,caller) = !(isDefined(getBoolean(this, getVoterKey(votingId, toString(caller)))))
73+
74+
75+func isBlackListed (caller) = getBlackListValue(toString(caller))
76+
77+
78+func calcVotesAmount (votingId,caller,attachment) = {
79+ let ticket = getTicketValue(toString(caller))
80+ let attachmentAssetId = value(attachment.assetId)
81+ if ((ticket == attachmentAssetId))
82+ then {
83+ let callerBalance = (assetBalance(caller, tokenId) * multiplier)
84+ $Tuple4(callerBalance, Burn(value(attachment.assetId), 1), DeleteEntry(getTicketKey(toString(caller))), BooleanEntry(getVoterKey(votingId, toString(caller)), true))
85+ }
86+ else throw("Wrong attachment asset")
87+ }
88+
89+
90+@Callable(i)
91+func init (pk) = {
92+ let admin = getString(this, "admin")
93+ if (!(isDefined(admin)))
94+ then if ((i.caller == this))
95+ then [StringEntry("admin", pk)]
96+ else throw("Only admin")
97+ else throw("Already inited")
98+ }
99+
100+
101+
102+@Callable(i)
103+func startVoting (votingId,votingDesc,period) = if (isAdmin(i.caller))
104+ then {
105+ let now = value(blockInfoByHeight(height)).timestamp
106+[StringEntry(getVotingDetailsKey(votingId), votingDesc), IntegerEntry(getVotingEndKey(votingId), (now + period)), IntegerEntry(getVotingVariantKey(votingId, 1), 0), IntegerEntry(getVotingVariantKey(votingId, 2), 0), IntegerEntry(getVotingVariantKey(votingId, 3), 0)]
107+ }
108+ else throw("Only admin")
109+
110+
111+
112+@Callable(i)
113+func issueNft (recipient) = if (if (isAdmin(i.caller))
114+ then !(isBlackListed(addressFromStringValue(recipient)))
115+ else false)
116+ then {
117+ let ticketKey = getTicketKey(recipient)
118+ if (!(isDefined(getBinary(this, ticketKey))))
119+ then {
120+ let issue = Issue("Ticket", "Multiplier for voting", 1, 0, false)
121+ let id = calculateAssetId(issue)
122+[issue, ScriptTransfer(addressFromStringValue(recipient), 1, id), BinaryEntry(ticketKey, id)]
123+ }
124+ else throw("Already granted")
125+ }
126+ else throw("Only admin")
127+
128+
129+
130+@Callable(i)
131+func getTokens () = {
132+ let key = getWhiteListKey(toString(i.caller))
133+ let granted = getWhiteListValue(toString(i.caller))
134+ if (!(granted))
135+ then [BooleanEntry(key, true), ScriptTransfer(i.caller, amountGetTokens, tokenId)]
136+ else throw("Already got")
137+ }
138+
139+
140+
141+@Callable(i)
142+func vote (votingId,variant) = if (!(isEndOfVoting(votingId)))
143+ then if (isCorrectVoter(votingId, i.caller))
144+ then {
145+ let votingKey = getVotingVariantKey(votingId, variant)
146+ let counter = getVotingVariantValue(votingId, variant)
147+ let blackListKey = getBlackListKey(toString(i.caller))
148+ if ((size(i.payments) != 1))
149+ then {
150+ let callerBalance = assetBalance(i.caller, tokenId)
151+[BooleanEntry(blackListKey, false), BooleanEntry(getVoterKey(votingId, toString(i.caller)), true), IntegerEntry(votingKey, (counter + callerBalance))]
152+ }
153+ else {
154+ let $t051845274 = calcVotesAmount(votingId, i.caller, i.payments[0])
155+ let voteAmount = $t051845274._1
156+ let burn = $t051845274._2
157+ let clear = $t051845274._3
158+ let record = $t051845274._4
159+[burn, clear, record, BooleanEntry(blackListKey, false), IntegerEntry(votingKey, (counter + voteAmount))]
160+ }
161+ }
162+ else throw("Invalid voter")
163+ else throw("Voting is ended")
164+
165+
166+
167+@Callable(i)
168+func joinProgram (patron) = {
169+ let validPatron = getWhiteListValue(patron)
170+ if (if (validPatron)
171+ then !(isBlackListed(i.caller))
172+ else false)
173+ then {
174+ let key = getWhiteListKey(toString(i.caller))
175+ let patronKey = getWhiteListKey(patron)
176+ let slot = getBoolean(this, key)
177+ if (!(isDefined(slot)))
178+ then [BooleanEntry(key, true), BooleanEntry(patronKey, false), ScriptTransfer(i.caller, amountGetTokens, tokenId)]
179+ else throw("Already in program")
180+ }
181+ else throw("Wrong patron or caller from blackList")
182+ }
183+
184+
185+
186+@Callable(i)
187+func buyItem (itemId) = if (!(isBlackListed(i.caller)))
188+ then {
189+ let pmt = i.payments[0]
190+ let amount = pmt.amount
191+ let price = getItemPriceValue(itemId)
192+ if (if ((value(pmt.assetId) == tokenId))
193+ then (price == amount)
194+ else false)
195+ then [Burn(tokenId, amount), StringEntry(getItemSoldKey(itemId), toString(i.caller))]
196+ else throw("Wrong payment assetId")
197+ }
198+ else throw("Caller from blackList")
199+
200+
201+@Verifier(tx)
202+func verify () = match tx {
203+ case dtx: DataTransaction =>
204+ if (!(isDefined(getString(dtx.data, "admin"))))
205+ then sigVerify(tx.bodyBytes, tx.proofs[0], fromBase58String(getStringValue(this, "admin")))
206+ else false
207+ case mtx: MassTransferTransaction =>
208+ sigVerify(tx.bodyBytes, tx.proofs[0], fromBase58String(getStringValue(this, "admin")))
209+ case _ =>
210+ sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey)
211+}
212+

github/deemru/w8io/026f985 
27.87 ms