tx · 4KmcyQi2QQ3359NkwCaJWzYdjxPjxK4gwTNtsB89EcS7

3Mz29fiz3zgY9JDbiHKANvHsFgQutdfu4Ua:  -0.01400000 Waves

2021.03.29 22:57 [1459486] smart account 3Mz29fiz3zgY9JDbiHKANvHsFgQutdfu4Ua > SELF 0.00000000 Waves

{ "type": 13, "id": "4KmcyQi2QQ3359NkwCaJWzYdjxPjxK4gwTNtsB89EcS7", "fee": 1400000, "feeAssetId": null, "timestamp": 1617047828949, "version": 2, "chainId": 84, "sender": "3Mz29fiz3zgY9JDbiHKANvHsFgQutdfu4Ua", "senderPublicKey": "CTyHhnVTxf16Z4CmGGneAK8WB5g2QyT4MB8kUn8vPPcu", "proofs": [ "4G2GEWd7jsP1XqPszp4SpGga3siwz87upnDpYwSeKNRrD1GYwVQ3Md6HHva7iG17tEhfcw3Jfrqvf5vSRus3bvwg" ], "script": "base64:AAIEAAAAAAAAAAQIAhIAAAAAAAAAAAEAAAABaQEAAAAEY2FsbAAAAAAEAAAABWFzc2V0CQAEQwAAAAcCAAAABUFzc2V0AgAAAAAAAAAAAAAAAAEAAAAAAAAAAAAGBQAAAAR1bml0AAAAAAAAAAAABAAAAAdhc3NldElkCQAEOAAAAAEFAAAABWFzc2V0CQAETAAAAAIJAQAAAAtCaW5hcnlFbnRyeQAAAAICAAAAA2JpbgEAAAAACQAETAAAAAIJAQAAAAxCb29sZWFuRW50cnkAAAACAgAAAARib29sBgkABEwAAAACCQEAAAAMSW50ZWdlckVudHJ5AAAAAgIAAAADaW50AAAAAAAAAAABCQAETAAAAAIJAQAAAAtTdHJpbmdFbnRyeQAAAAICAAAAA3N0cgIAAAAACQAETAAAAAIJAQAAAAtEZWxldGVFbnRyeQAAAAECAAAAA3N0cgkABEwAAAACBQAAAAVhc3NldAkABEwAAAACCQEAAAAHUmVpc3N1ZQAAAAMFAAAAB2Fzc2V0SWQAAAAAAAAAAAEHCQAETAAAAAIJAQAAAARCdXJuAAAAAgUAAAAHYXNzZXRJZAAAAAAAAAAAAQkABEwAAAACCQEAAAAOU2NyaXB0VHJhbnNmZXIAAAADCAUAAAABaQAAAAZjYWxsZXIAAAAAAAAAAAEFAAAAB2Fzc2V0SWQFAAAAA25pbAAAAAEAAAACdHgBAAAABnZlcmlmeQAAAAAJAAH0AAAAAwgFAAAAAnR4AAAACWJvZHlCeXRlcwkAAZEAAAACCAUAAAACdHgAAAAGcHJvb2ZzAAAAAAAAAAAACAUAAAACdHgAAAAPc2VuZGVyUHVibGljS2V5KOU8bg==", "height": 1459486, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: CseydXLHVp7PV5hs8ejcvhJEKLQwxNnKzmypp64AgXNB Next: AiaYmsFwgMEe37gTwXgCtTtKKArDWLTsDML1J3eXVZrz Full:
OldNewDifferences
11 {-# STDLIB_VERSION 4 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
4-let separator = "___"
5-
6-let genesisHeight = 1456230
7-
8-let wavesId = "WAVES"
9-
10-let maxInt = 9223372036854775805
11-
12-let maxDataKeySize = 400
13-
14-let maxDescriptionBytes = 1000
15-
16-let contractName = "VaultContract"
17-
18-let contractText = "blah lblah"
19-
20-let contractListSize = 5
21-
22-let receiptName = "VaultReceipt"
23-
24-let receiptText = "fuck off"
25-
26-let keyNonceCount = "NONCE_COUNT"
27-
28-func generateNonce () = match getInteger(this, keyNonceCount) {
29- case isInt: Int =>
30- if ((isInt >= maxInt))
31- then 1
32- else (isInt + 1)
33- case _ =>
34- 1
35-}
36-
37-
38-func findSeparatorInListString (result,stringToCheck) = if ((result == true))
39- then true
40- else contains(stringToCheck, separator)
414
425
436 @Callable(i)
44-func deposit () = if ((genesisHeight > height))
45- then throw("ERROR: Deposits frozen")
46- else if ((this == i.caller))
47- then throw("ERROR: Self-invoke is forbidden")
48- else if ((size(i.payments) != 1))
49- then throw("ERROR: Attached Payment != 1")
50- else if (if ((1 > i.payments[0].amount))
51- then true
52- else (i.payments[0].amount > maxInt))
53- then throw("ERROR: Payment amount")
54- else {
55- let contractAssetId = match i.payments[0].assetId {
56- case isByteVector: ByteVector =>
57- match assetInfo(isByteVector) {
58- case isAsset: Asset =>
59- toBase58String(isAsset.id)
60- case _ =>
61- throw("ERROR: Asset not found")
62- }
63- case isWaves: Unit =>
64- wavesId
65- case _ =>
66- throw("ERROR: Unknown Asset type")
67- }
68- let nonce = generateNonce()
69- let contractList = [contractText, toString(height), toString(i.caller), contractAssetId, toString(i.payments[0].amount)]
70- if (({
71- let $list24072462 = contractList
72- let $size24072462 = size($list24072462)
73- let $acc024072462 = false
74- if (($size24072462 == 0))
75- then $acc024072462
76- else {
77- let $acc124072462 = findSeparatorInListString($acc024072462, $list24072462[0])
78- if (($size24072462 == 1))
79- then $acc124072462
80- else {
81- let $acc224072462 = findSeparatorInListString($acc124072462, $list24072462[1])
82- if (($size24072462 == 2))
83- then $acc224072462
84- else {
85- let $acc324072462 = findSeparatorInListString($acc224072462, $list24072462[2])
86- if (($size24072462 == 3))
87- then $acc324072462
88- else {
89- let $acc424072462 = findSeparatorInListString($acc324072462, $list24072462[3])
90- if (($size24072462 == 4))
91- then $acc424072462
92- else {
93- let $acc524072462 = findSeparatorInListString($acc424072462, $list24072462[4])
94- if (($size24072462 == 5))
95- then $acc524072462
96- else {
97- let $acc624072462 = findSeparatorInListString($acc524072462, $list24072462[5])
98- throw("List size exceed 5")
99- }
100- }
101- }
102- }
103- }
104- }
105- } == true))
106- then throw("ERROR: Found separator in string")
107- else {
108- let contractDescription = makeString(contractList, separator)
109- if ((size(toBytes(contractDescription)) > maxDescriptionBytes))
110- then throw("ERROR: Too long contract")
111- else {
112- let contractIssue = Issue(contractName, contractDescription, 1, 0, false, unit, nonce)
113- let contractId = calculateAssetId(contractIssue)
114-[IntegerEntry(keyNonceCount, nonce), contractIssue, ScriptTransfer(i.caller, contractIssue.quantity, contractId)]
115- }
116- }
117- }
118-
119-
120-
121-@Callable(i)
122-func withdraw () = if ((this == i.caller))
123- then throw("ERROR: Self-invoke is forbidden")
124- else if ((size(i.payments) != 1))
125- then throw("ERROR: Attached Payment != 1")
126- else if ((i.payments[0].amount != 1))
127- then throw("ERROR: Payment amount != 1")
128- else {
129- let contractIdByteVector = match i.payments[0].assetId {
130- case isByteVector: ByteVector =>
131- isByteVector
132- case _ =>
133- throw("ERROR: Contract type")
134- }
135- let contractInfo = match assetInfo(contractIdByteVector) {
136- case isAsset: Asset =>
137- isAsset
138- case _ =>
139- throw("ERROR: Unknown Contract")
140- }
141- let contractList = split(contractInfo.description, separator)
142- if ((contractInfo.issuer != this))
143- then throw("ERROR: Contract Issuer")
144- else if ((size(contractList) != contractListSize))
145- then throw("ERROR: Contract list")
146- else if ((contractInfo.name != contractName))
147- then throw("ERROR: Contract name")
148- else if (if (if (if ((contractInfo.decimals != 0))
149- then true
150- else (contractInfo.quantity != 1))
151- then true
152- else (contractInfo.reissuable != false))
153- then true
154- else (contractInfo.scripted != false))
155- then throw("ERROR: Contract not NFT")
156- else {
157- let contractHeight = parseIntValue(contractList[1])
158- let contractCaller = contractList[2]
159- let contractAssetId = contractList[3]
160- let contractAssetQuantity = parseIntValue(contractList[4])
161- let contractCallerAddress = match addressFromString(contractCaller) {
162- case isAddress: Address =>
163- isAddress
164- case _ =>
165- throw("ERROR: Caller Address")
166- }
167- let contractAssetInfo = match assetInfo(fromBase58String(contractAssetId)) {
168- case isAsset: Asset =>
169- isAsset
170- case _ =>
171- throw("ERROR: Unknown Asset")
172- }
173- if (if ((genesisHeight >= contractHeight))
174- then true
175- else (contractHeight >= height))
176- then throw("ERROR: Height")
177- else if (if (if ((1 > contractAssetQuantity))
178- then true
179- else (contractAssetQuantity > contractAssetInfo.quantity))
180- then true
181- else (contractAssetQuantity > maxInt))
182- then throw("ERROR: Asset quantity")
183- else if ((contractAssetQuantity > assetBalance(this, contractAssetInfo.id)))
184- then throw("ERROR: Vault balance")
185- else {
186- let nonce = generateNonce()
187- let receiptList = [receiptText, toString(contractHeight), toString(height), toBase58String(contractIdByteVector), contractCaller, toString(i.caller), contractAssetId, toString(contractAssetQuantity)]
188- if (({
189- let $list61286182 = receiptList
190- let $size61286182 = size($list61286182)
191- let $acc061286182 = false
192- if (($size61286182 == 0))
193- then $acc061286182
194- else {
195- let $acc161286182 = findSeparatorInListString($acc061286182, $list61286182[0])
196- if (($size61286182 == 1))
197- then $acc161286182
198- else {
199- let $acc261286182 = findSeparatorInListString($acc161286182, $list61286182[1])
200- if (($size61286182 == 2))
201- then $acc261286182
202- else {
203- let $acc361286182 = findSeparatorInListString($acc261286182, $list61286182[2])
204- if (($size61286182 == 3))
205- then $acc361286182
206- else {
207- let $acc461286182 = findSeparatorInListString($acc361286182, $list61286182[3])
208- if (($size61286182 == 4))
209- then $acc461286182
210- else {
211- let $acc561286182 = findSeparatorInListString($acc461286182, $list61286182[4])
212- if (($size61286182 == 5))
213- then $acc561286182
214- else {
215- let $acc661286182 = findSeparatorInListString($acc561286182, $list61286182[5])
216- if (($size61286182 == 6))
217- then $acc661286182
218- else {
219- let $acc761286182 = findSeparatorInListString($acc661286182, $list61286182[6])
220- if (($size61286182 == 7))
221- then $acc761286182
222- else {
223- let $acc861286182 = findSeparatorInListString($acc761286182, $list61286182[7])
224- if (($size61286182 == 8))
225- then $acc861286182
226- else {
227- let $acc961286182 = findSeparatorInListString($acc861286182, $list61286182[8])
228- throw("List size exceed 8")
229- }
230- }
231- }
232- }
233- }
234- }
235- }
236- }
237- }
238- } == true))
239- then throw("ERROR: Found separator in string")
240- else {
241- let receiptDescription = makeString(receiptList, separator)
242- let receiptIssue = Issue(receiptName, receiptDescription, 1, 0, false, unit, nonce)
243- let receiptId = calculateAssetId(receiptIssue)
244-[IntegerEntry(keyNonceCount, nonce), Burn(contractIdByteVector, 1), receiptIssue, ScriptTransfer(i.caller, receiptIssue.quantity, receiptId), ScriptTransfer(i.caller, contractAssetQuantity, contractAssetInfo.id)]
245- }
246- }
247- }
248- }
7+func call () = {
8+ let asset = Issue("Asset", "", 1, 0, true, unit, 0)
9+ let assetId = calculateAssetId(asset)
10+[BinaryEntry("bin", base58''), BooleanEntry("bool", true), IntegerEntry("int", 1), StringEntry("str", ""), DeleteEntry("str"), asset, Reissue(assetId, 1, false), Burn(assetId, 1), ScriptTransfer(i.caller, 1, assetId)]
11+ }
24912
25013
25114 @Verifier(tx)
252-func verify () = match tx {
253- case isUpdate: SetScriptTransaction =>
254- sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey)
255- case _ =>
256- false
257-}
15+func verify () = sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey)
25816

github/deemru/w8io/169f3d6 
55.80 ms