tx · 4w1T4B3JoboJF9PB5D5zcFfdKykFAH3XKZbHPd6NSqjk

3N7mcnyMx43UGuYmV6za6JtNht6he2SNSMc:  -0.01000000 Waves

2019.09.15 16:06 [677378] smart account 3N7mcnyMx43UGuYmV6za6JtNht6he2SNSMc > SELF 0.00000000 Waves

{ "type": 13, "id": "4w1T4B3JoboJF9PB5D5zcFfdKykFAH3XKZbHPd6NSqjk", "fee": 1000000, "feeAssetId": null, "timestamp": 1568552836138, "version": 1, "sender": "3N7mcnyMx43UGuYmV6za6JtNht6he2SNSMc", "senderPublicKey": "Hstbp92tkq4U7rc7xMF4Czumq7E2pvf5uzDvrBCpfnFY", "proofs": [ "5MpK5KKvvNLHfxSF3B5xsnAQ5ot2X6x3EqNbv6YBvZkA2DYaGx5VWiCqAc6UNTbjm4WTpog7wRBYzrv7ztsBbvAR" ], "script": "base64:AAIDAAAAAAAAAAAAAAAfAQAAABNnZXRFeHRBZGRyZXNzT3JhY2xlAAAAAAkBAAAAB2V4dHJhY3QAAAABCQEAAAARYWRkcmVzc0Zyb21TdHJpbmcAAAABAgAAACMzTjdqZVVoOTU1WEVWdWpyeXN0MjR0WEt6Vm0yZlhXc1pEUwAAAAALQkxBQ0tMSVNURUQCAAAACWJsYWNrbGlzdAAAAAALb3duZXJQdWJLZXkBAAAAIPrEYDZepvHq0oWSQIbSFlDGqm+OsXY0MXmZS/QX/xpfAAAAAAROT05FAgAAAARub25lAAAAAAZDTE9TRUQCAAAABWNsb3NlAAAAAAZPUEVORUQCAAAABG9wZW4BAAAADmdldE51bWJlckJ5S2V5AAAAAQAAAANrZXkEAAAAA251bQQAAAAHJG1hdGNoMAkABBoAAAACBQAAAAR0aGlzBQAAAANrZXkDCQAAAQAAAAIFAAAAByRtYXRjaDACAAAAA0ludAQAAAABYQUAAAAHJG1hdGNoMAUAAAABYQAAAAAAAAAAAAUAAAADbnVtAQAAAAtnZXRTdHJCeUtleQAAAAEAAAADa2V5BAAAAANzdHIEAAAAByRtYXRjaDA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B0VHJhbnNhY3Rpb24EAAAAAXMFAAAAByRtYXRjaDAJAAH0AAAAAwgFAAAAAnR4AAAACWJvZHlCeXRlcwkAAZEAAAACCAUAAAACdHgAAAAGcHJvb2ZzAAAAAAAAAAAABQAAAAtvd25lclB1YktleQMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAAPRGF0YVRyYW5zYWN0aW9uBAAAAAFkBQAAAAckbWF0Y2gwBgMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAATVHJhbnNmZXJUcmFuc2FjdGlvbgQAAAABdAUAAAAHJG1hdGNoMAkAAfQAAAADCAUAAAACdHgAAAAJYm9keUJ5dGVzCQABkQAAAAIIBQAAAAJ0eAAAAAZwcm9vZnMAAAAAAAAAAAAFAAAAC293bmVyUHViS2V5B2h/8/Q=", "chainId": 84, "height": 677378, "spentComplexity": 0 } View: original | compacted Prev: none Next: none Full:
OldNewDifferences
1-# no script
1+{-# STDLIB_VERSION 3 #-}
2+{-# SCRIPT_TYPE ACCOUNT #-}
3+{-# CONTENT_TYPE DAPP #-}
4+func getExtAddressOracle () = extract(addressFromString("3N7jeUh955XEVujryst24tXKzVm2fXWsZDS"))
5+
6+
7+let BLACKLISTED = "blacklist"
8+
9+let ownerPubKey = base58'Hstbp92tkq4U7rc7xMF4Czumq7E2pvf5uzDvrBCpfnFY'
10+
11+let NONE = "none"
12+
13+let CLOSED = "close"
14+
15+let OPENED = "open"
16+
17+func getNumberByKey (key) = {
18+ let num = match getInteger(this, key) {
19+ case a: Int =>
20+ a
21+ case _ =>
22+ 0
23+ }
24+ num
25+ }
26+
27+
28+func getStrByKey (key) = {
29+ let str = match getString(this, key) {
30+ case a: String =>
31+ a
32+ case _ =>
33+ NONE
34+ }
35+ str
36+ }
37+
38+
39+func getKeyRoom (roomer,title) = ("room_" + toBase58String(sha256(toBytes((roomer + title)))))
40+
41+
42+func getKeyRoomPrize (room) = (room + "_prize")
43+
44+
45+func getValueRoomPrize (room) = getNumberByKey(getKeyRoomPrize(room))
46+
47+
48+func getKeyRoomRoomer (room) = (room + "_roomer")
49+
50+
51+func getValueRoomRoomer (room) = getStrByKey(getKeyRoomRoomer(room))
52+
53+
54+func getKeyRoomLimit (room) = (room + "_limit")
55+
56+
57+func getValueRoomLimit (room) = getNumberByKey(getKeyRoomLimit(room))
58+
59+
60+func getKeyRoomStatus (room) = (room + "_status")
61+
62+
63+func getValueRoomStatus (room) = getStrByKey(getKeyRoomStatus(room))
64+
65+
66+func getKeyPropose (contributor,outline) = ("propose_" + toBase58String(sha256(toBytes((contributor + outline)))))
67+
68+
69+func getKeyProposeContributor (propose) = (propose + "_contributor")
70+
71+
72+func getValueProposeContributor (propose) = getStrByKey(getKeyProposeContributor(propose))
73+
74+
75+func getKeyProposeData (propose) = (propose + "_data")
76+
77+
78+func getValueProposeData (propose) = getStrByKey(getKeyProposeData(propose))
79+
80+
81+func getKeyAdoption (room,propose) = ("adoption_" + toBase58String(sha256(toBytes((room + propose)))))
82+
83+
84+func getKeyAdoptionWinner (adoption) = (adoption + "_winner")
85+
86+
87+func getValueAdoptionWinner (adoption) = getStrByKey(getKeyAdoptionWinner(adoption))
88+
89+
90+func getKeyAdoptionPrize (adoption) = (adoption + "_prize")
91+
92+
93+func getValueAdoptionPrize (adoption) = getStrByKey(getKeyAdoptionPrize(adoption))
94+
95+
96+func getKeyBalanceUser (account) = (account + "_balance")
97+
98+
99+func getValueBalanceUser (account) = getNumberByKey(getKeyBalanceUser(account))
100+
101+
102+func getExtKeyUserBlackListStatus (account) = (account + "_blacklisted")
103+
104+
105+func getExtValueUserBlackListStatus (oracle,account) = {
106+ let str = match getString(oracle, getExtKeyUserBlackListStatus(account)) {
107+ case a: String =>
108+ a
109+ case _ =>
110+ NONE
111+ }
112+ str
113+ }
114+
115+
116+@Callable(i)
117+func createRoom (title,now,duration) = {
118+ let pmt = extract(i.payment)
119+ if (isDefined(pmt.assetId))
120+ then throw("can use WAVES only at the moment")
121+ else {
122+ let roomer = toBase58String(i.caller.bytes)
123+ let room = getKeyRoom(roomer, title)
124+ let prize = pmt.amount
125+ let oracle = getExtAddressOracle()
126+ let roomerVerify = getExtValueUserBlackListStatus(oracle, roomer)
127+ let limit = (now + duration)
128+ if ((0 >= prize))
129+ then throw("prize cannot be negative amount")
130+ else if ((360 >= duration))
131+ then throw("duration cannot be less than 6hours")
132+ else if ((getValueRoomRoomer(room) != NONE))
133+ then throw("the room is already exist")
134+ else if ((roomerVerify == BLACKLISTED))
135+ then throw("your request was denied")
136+ else WriteSet([DataEntry(getKeyRoomPrize(room), prize), DataEntry(getKeyRoomRoomer(room), roomer), DataEntry(getKeyRoomLimit(room), limit), DataEntry(getKeyRoomStatus(room), OPENED)])
137+ }
138+ }
139+
140+
141+
142+@Callable(i)
143+func closeRoom (room) = {
144+ let roomer = getValueRoomRoomer(room)
145+ let prize = getValueRoomPrize(room)
146+ if ((roomer != toBase58String(i.caller.bytes)))
147+ then throw("you cannot close this Room")
148+ else if ((getValueRoomStatus(room) == CLOSED))
149+ then throw("this Room has already closed")
150+ else ScriptResult(WriteSet([DataEntry(getKeyRoomStatus(room), CLOSED)]), TransferSet([ScriptTransfer(addressFromStringValue(roomer), prize, unit)]))
151+ }
152+
153+
154+
155+@Callable(i)
156+func createProposal (room,data,outline,now) = {
157+ let contributor = toBase58String(i.caller.bytes)
158+ let oracle = getExtAddressOracle()
159+ let contributorVerify = getExtValueUserBlackListStatus(oracle, contributor)
160+ let propose = getKeyPropose(contributor, outline)
161+ let roomer = getValueRoomRoomer(room)
162+ let limit = getValueRoomLimit(room)
163+ if ((data == NONE))
164+ then throw("your proposal is empty")
165+ else if ((roomer == NONE))
166+ then throw("room does not exist")
167+ else if ((now >= limit))
168+ then throw("propose to this room is already closed")
169+ else if ((contributorVerify == BLACKLISTED))
170+ then throw("your request was denied")
171+ else if ((getValueRoomStatus(room) == CLOSED))
172+ then throw("this Room has already closed")
173+ else WriteSet([DataEntry(getKeyProposeContributor(propose), contributor), DataEntry(getKeyProposeData(propose), data)])
174+ }
175+
176+
177+
178+@Callable(i)
179+func createAdoption (room,propose) = {
180+ let adoption = getKeyAdoption(room, propose)
181+ let prize = getValueRoomPrize(room)
182+ let winner = getValueProposeContributor(propose)
183+ let roomer = getValueRoomRoomer(room)
184+ if ((roomer != toBase58String(i.caller.bytes)))
185+ then throw("only the Room's owner can do this transaction")
186+ else if ((winner == NONE))
187+ then throw("the winner doesn't exist")
188+ else if ((getValueAdoptionWinner(adoption) != NONE))
189+ then throw("you have already do the adoption")
190+ else if ((getValueRoomStatus(room) == CLOSED))
191+ then throw("this Room has already closed")
192+ else WriteSet([DataEntry(getKeyBalanceUser(winner), (getValueBalanceUser(winner) + prize)), DataEntry(getKeyAdoptionWinner(adoption), winner), DataEntry(getKeyAdoptionPrize(adoption), prize), DataEntry(getKeyRoomStatus(room), CLOSED)])
193+ }
194+
195+
196+
197+@Callable(i)
198+func withdraw () = {
199+ let user = toBase58String(i.caller.bytes)
200+ let balance = getValueBalanceUser(user)
201+ if ((0 >= balance))
202+ then throw("you have nothing to withdraw")
203+ else ScriptResult(WriteSet([DataEntry(getKeyBalanceUser(user), 0)]), TransferSet([ScriptTransfer(addressFromStringValue(user), balance, unit)]))
204+ }
205+
206+
207+@Verifier(tx)
208+func varify () = match tx {
209+ case s: SetScriptTransaction =>
210+ sigVerify(tx.bodyBytes, tx.proofs[0], ownerPubKey)
211+ case d: DataTransaction =>
212+ true
213+ case t: TransferTransaction =>
214+ sigVerify(tx.bodyBytes, tx.proofs[0], ownerPubKey)
215+ case _ =>
216+ false
217+}
218+

github/deemru/w8io/169f3d6 
29.24 ms