tx · DceYtsNB4uh5tvBkwxTzFfYmjTQPxWkeCoy8rNxUuoqV

3NCZ57kfAyy5g1u9wU6xpPATZaGHQsWtdii:  -0.01400000 Waves

2020.12.25 16:49 [1324302] smart account 3NCZ57kfAyy5g1u9wU6xpPATZaGHQsWtdii > SELF 0.00000000 Waves

{ "type": 13, "id": "DceYtsNB4uh5tvBkwxTzFfYmjTQPxWkeCoy8rNxUuoqV", "fee": 1400000, "feeAssetId": null, "timestamp": 1608904146442, "version": 2, "chainId": 84, "sender": "3NCZ57kfAyy5g1u9wU6xpPATZaGHQsWtdii", "senderPublicKey": "9qhZSTJv6GQKghqH88TBPU6rNvQWf6yXCL57T7C7oi7A", "proofs": [ "3dnDWPVNUrnzTcbFtKfdQGFZasXPSwxzpMNDQK5QjxYtm82inUs3kbtfbKof3YezGD69KnXxVv3RATgCXzgGRYDe" ], "script": "base64:AAIEAAAAAAAAAAsIAhIHCgUICAEBBAAAAAIAAAAABFBBUjcBAAAAIM5YQP2Y4rTFk3fjHMVSaCtBnCyxqxHVfGnKN+eS6UeMAAAAAAhzd2FwUmF0ZQAAAAAAAAAAAQAAAAEAAAABaQEAAAAKaXNzdWVBc3NldAAAAAUAAAAEbmFtZQAAAAtkZXNjcmlwdGlvbgAAAAZhbW91bnQAAAAIZGVjaW1hbHMAAAAHcmVJc3N1ZQQAAAADcG10CQABkQAAAAIIBQAAAAFpAAAACHBheW1lbnRzAAAAAAAAAAAAAwkBAAAAAiE9AAAAAggFAAAAA3BtdAAAAAdhc3NldElkBQAAAARQQVI3CQAAAgAAAAECAAAAFHdvcmtzIHdpdGggUEFSNyBvbmx5BAAAAApzd2FwQW1vdW50CQAAaAAAAAIIBQAAAANwbXQAAAAGYW1vdW50BQAAAAhzd2FwUmF0ZQQAAAAFaXNzdWUJAARCAAAABQUAAAAEbmFtZQUAAAALZGVzY3JpcHRpb24FAAAABmFtb3VudAUAAAAIZGVjaW1hbHMFAAAAB3JlSXNzdWUEAAAAAmlkCQAEOAAAAAEFAAAABWlzc3VlCQAETAAAAAIFAAAABWlzc3VlCQAETAAAAAIJAQAAAA5TY3JpcHRUcmFuc2ZlcgAAAAMIBQAAAAFpAAAABmNhbGxlcggFAAAABWlzc3VlAAAACHF1YW50aXR5BQAAAAJpZAUAAAADbmlsAAAAAQAAAAJ0eAEAAAAGdmVyaWZ5AAAAAAkAAfQAAAADCAUAAAACdHgAAAAJYm9keUJ5dGVzCQABkQAAAAIIBQAAAAJ0eAAAAAZwcm9vZnMAAAAAAAAAAAAIBQAAAAJ0eAAAAA9zZW5kZXJQdWJsaWNLZXn5XhJZ", "height": 1324302, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: GFgXCaWNgBkEKdyxrVYofep8boLpHXqdfP1hGMnKhuk Next: Dkh8G8uPEKVBx323vSWWnyQBdJAtgDN6QPzQZ8Zfq52o Full:
OldNewDifferences
1-{-# STDLIB_VERSION 3 #-}
1+{-# STDLIB_VERSION 4 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
4+let PAR7 = base58'EtV3CXQ4wqm28WPB1KaBv5B9ke2bpXRZMutYNEJUQcXm'
45
6+let swapRate = 1
57
68 @Callable(i)
7-func sponsorDeposit (compestart,assetName,compenum) = {
8- let compeNum = toString(compenum)
9- let compeStart = toString(compestart)
10- let pmt = extract(i.payment)
11- let paymentId = pmt.assetId
12- let currentKey = toBase58String(i.caller.bytes)
13- let currentAmount = match getInteger(this, (((compeNum + assetName) + compeStart) + currentKey)) {
14- case a: Int =>
15- a
16- case _ =>
17- 0
18- }
19- let newAmount = (currentAmount + pmt.amount)
20- WriteSet([DataEntry((((compeNum + assetName) + compeStart) + currentKey), newAmount), DataEntry((((compeNum + compeStart) + assetName) + currentKey), compestart)])
21- }
22-
23-
24-
25-@Callable(i)
26-func sponsorWithdraw (startTimestamp,assetName,compenum,amount,id,nowTimestamp) = {
27- let compestart = toString(startTimestamp)
28- let compeNum = toString(compenum)
29- let assetId = fromBase58String(id)
30- let currentKey = toBase58String(i.caller.bytes)
31- let compeStart = match getInteger(this, (((compeNum + compestart) + assetName) + currentKey)) {
32- case a: Int =>
33- a
34- case _ =>
35- 0
36- }
37- let currentAmount = match getInteger(this, (((compeNum + assetName) + compestart) + currentKey)) {
38- case a: Int =>
39- a
40- case _ =>
41- 0
42- }
43- let newAmount = (currentAmount - amount)
44- if ((nowTimestamp > startTimestamp))
45- then throw("Can't withdraw compe start")
46- else if ((0 > amount))
47- then throw("Can't withdraw negative amount")
48- else if ((0 > newAmount))
49- then throw("Not enough balance")
50- else if ((id == "WAVES"))
51- then ScriptResult(WriteSet([DataEntry((((compeNum + assetName) + compestart) + currentKey), newAmount)]), TransferSet([ScriptTransfer(i.caller, amount, unit)]))
52- else ScriptResult(WriteSet([DataEntry((((compeNum + assetName) + compestart) + currentKey), newAmount)]), TransferSet([ScriptTransfer(i.caller, amount, assetId)]))
53- }
54-
55-
56-
57-@Callable(i)
58-func paymentDeposit (courseaddress,lockernum,markername) = {
59- let lockerNum = toString(lockernum)
60- let pmt = extract(i.payment)
61- let markerId = pmt.assetId
62- let currentKey = toBase58String(i.caller.bytes)
63- let currentAmount = match getInteger(this, (((("pd_" + markername) + courseaddress) + lockerNum) + currentKey)) {
64- case a: Int =>
65- a
66- case _ =>
67- 0
68- }
69- let newAmount = (currentAmount + pmt.amount)
70- WriteSet([DataEntry((((("pd_" + markername) + courseaddress) + lockerNum) + currentKey), newAmount), DataEntry((((("pw_" + markername) + courseaddress) + lockerNum) + currentKey), true), DataEntry((((("cw_" + markername) + courseaddress) + lockerNum) + currentKey), false)])
71- }
72-
73-
74-
75-@Callable(i)
76-func paymentWithdraw (courseaddress,lockernum,markername,markerid,amount) = {
77- let lockerNum = toString(lockernum)
78- let assetId = fromBase58String(markerid)
79- let currentKey = toBase58String(i.caller.bytes)
80- let paymentWithdraw = match getBoolean(this, (((("pw_" + markername) + courseaddress) + lockerNum) + currentKey)) {
81- case a: Boolean =>
82- a
83- case _ =>
84- 0
85- }
86- let currentAmount = match getInteger(this, (((("pd_" + markername) + courseaddress) + lockerNum) + currentKey)) {
87- case a: Int =>
88- a
89- case _ =>
90- 0
91- }
92- let newAmount = (currentAmount - amount)
93- if ((paymentWithdraw == false))
94- then throw("Can't withdraw")
95- else if ((0 > amount))
96- then throw("Can't withdraw negative amount")
97- else if ((0 > newAmount))
98- then throw("Not enough balance")
99- else if ((markerid == "WAVES"))
100- then ScriptResult(WriteSet([DataEntry((((("pd_" + markername) + courseaddress) + lockerNum) + currentKey), newAmount)]), TransferSet([ScriptTransfer(i.caller, amount, unit)]))
101- else ScriptResult(WriteSet([DataEntry((((("pd_" + markername) + courseaddress) + lockerNum) + currentKey), newAmount)]), TransferSet([ScriptTransfer(i.caller, amount, assetId)]))
102- }
103-
104-
105-
106-@Callable(i)
107-func golferAuth (courseaddress,lockernum,markername) = {
108- let lockerNum = toString(lockernum)
109- let currentKey = toBase58String(i.caller.bytes)
110- WriteSet([DataEntry((((("pw_" + markername) + courseaddress) + lockerNum) + currentKey), false)])
111- }
112-
113-
114-
115-@Callable(i)
116-func courseAuth (golferaddress,lockernum,markername) = {
117- let lockerNum = toString(lockernum)
118- let currentKey = toBase58String(i.caller.bytes)
119- WriteSet([DataEntry((((("cw_" + markername) + currentKey) + lockerNum) + golferaddress), true)])
120- }
121-
122-
123-
124-@Callable(i)
125-func courseWithdraw (golferaddress,lockernum,markername,markerid,amount) = {
126- let lockerNum = toString(lockernum)
127- let assetId = fromBase58String(markerid)
128- let currentKey = toBase58String(i.caller.bytes)
129- let paymentWithdraw = match getBoolean(this, (((("pw_" + markername) + currentKey) + lockerNum) + golferaddress)) {
130- case a: Boolean =>
131- a
132- case _ =>
133- 0
134- }
135- let courseWithdraw = match getBoolean(this, (((("cw_" + markername) + currentKey) + lockerNum) + golferaddress)) {
136- case a: Boolean =>
137- a
138- case _ =>
139- 0
140- }
141- let currentAmount = match getInteger(this, (((("pd_" + markername) + currentKey) + lockerNum) + golferaddress)) {
142- case a: Int =>
143- a
144- case _ =>
145- 0
146- }
147- let newAmount = (currentAmount - amount)
148- if ((paymentWithdraw == true))
149- then throw("Can't golfer auth")
150- else if ((courseWithdraw == false))
151- then throw("Can't golfcourse auth")
152- else if ((0 > amount))
153- then throw("Can't withdraw negative amount")
154- else if ((0 > newAmount))
155- then throw("Not enough balance")
156- else if ((markerid == "WAVES"))
157- then ScriptResult(WriteSet([DataEntry((((("pd_" + markername) + currentKey) + lockerNum) + golferaddress), newAmount)]), TransferSet([ScriptTransfer(i.caller, amount, unit)]))
158- else ScriptResult(WriteSet([DataEntry((((("pd_" + markername) + currentKey) + lockerNum) + golferaddress), newAmount)]), TransferSet([ScriptTransfer(i.caller, amount, assetId)]))
9+func issueAsset (name,description,amount,decimals,reIssue) = {
10+ let pmt = i.payments[0]
11+ if ((pmt.assetId != PAR7))
12+ then throw("works with PAR7 only")
13+ else {
14+ let swapAmount = (pmt.amount * swapRate)
15+ let issue = Issue(name, description, amount, decimals, reIssue)
16+ let id = calculateAssetId(issue)
17+[issue, ScriptTransfer(i.caller, issue.quantity, id)]
18+ }
15919 }
16020
16121
16222 @Verifier(tx)
163-func verify () = match tx {
164- case ttx: TransferTransaction =>
165- sigVerify(ttx.bodyBytes, ttx.proofs[0], ttx.senderPublicKey)
166- case stx: SetScriptTransaction =>
167- sigVerify(stx.bodyBytes, stx.proofs[0], stx.senderPublicKey)
168- case _ =>
169- true
170-}
23+func verify () = sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey)
17124

github/deemru/w8io/169f3d6 
35.52 ms