tx · FatyWDzPd2qMCMinBxzhepp789WFCHHS9Xe2GFTAofPH 3MvebeGZYw4DzztAuqcdxyT22s6rB3yMNj7: -0.01000000 Waves 2022.03.17 01:53 [1967134] smart account 3MvebeGZYw4DzztAuqcdxyT22s6rB3yMNj7 > SELF 0.00000000 Waves
{ "type": 13, "id": "FatyWDzPd2qMCMinBxzhepp789WFCHHS9Xe2GFTAofPH", "fee": 1000000, "feeAssetId": null, "timestamp": 1647471061411, "version": 2, "chainId": 84, "sender": "3MvebeGZYw4DzztAuqcdxyT22s6rB3yMNj7", "senderPublicKey": "J283pC8bzRfJ3j1oxPrgDH8hjUVhFZS2CiRcPTmzQukz", "proofs": [ "4dBzEAd95KgE1s3ZPciqcqNZTz1BHt4PZsJZEo1uaNHu5VELEEwF5dMX5sKuG1R8MoaqdEPWHmSGoWX9wVMc7Viu" ], "script": "base64:AAIFAAAAAAAAAA8IAhIECgIIARIFCgMIAQEAAAAbAAAAAApkZWxheUJsb2NrAAAAAAAAAAABAAAAAAptaW5QYXltZW50AAAAAAAF9eEAAAAAABFhY2NlcHRhYmxlQXNzZXRJZAEAAAAg5PpGdWo9J1HbfiCa7IUj8tNs55tRKSuPgPaCoKWt9soAAAAADG1zZ1BhZ2FtZW50bwkAASwAAAACCQABLAAAAAIJAAEsAAAAAgIAAAAgRGV2aSBlZmZldHR1YXJlIHVuIHBhZ2FtZW50byBpbiAJAAJYAAAAAQUAAAARYWNjZXB0YWJsZUFzc2V0SWQCAAAACyBkaSBhbG1lbm8gCQABpAAAAAEFAAAACm1pblBheW1lbnQAAAAAEmZpZWxkTmFtZVJpc3VsdGF0bwIAAAANc2VtZV9lc3RyYXR0bwAAAAANZmllbGROYW1lU2VlZAIAAAAEc2VlZAAAAAAQZmllbGROYW1lU2VlZEIxNgIAAAAIc2VlZF9iMTYAAAAAGWZpZWxkTmFtZUhlaWdodEV4dHJhY3Rpb24CAAAAEWhlaWdodF9leHRyYWN0aW9uAAAAAA1maWVsZE5hbWVKc29uA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ACXJpY2hpZXN0YQUAAAADbmlsAAAAAgAAAAFpAQAAAAZlc3RyYWkAAAACAAAACXJpY2hpZXN0YQAAAAZudW1lcm8JAQAAAAdlc3RyYWkxAAAAAwUAAAAJcmljaGllc3RhBQAAAAZudW1lcm8FAAAAAWkAAAABaQEAAAAIcmVnaXN0cmEAAAADAAAACXJpY2hpZXN0YQAAAAtjYXJkaW5hbGl0YQAAAAplc3RyYXppb25pAwkBAAAAC2lzUGF5bWVudE9rAAAAAQUAAAABaQkBAAAACXJlZ2lzdHJhMQAAAAQFAAAACXJpY2hpZXN0YQUAAAALY2FyZGluYWxpdGEFAAAACmVzdHJhemlvbmkFAAAAAWkJAAACAAAAAQUAAAAMbXNnUGFnYW1lbnRvAAAAAKghYNY=", "height": 1967134, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 8gwAVCQHrmC8bwBmBWXBzSvSc4GT8b1K392r6DUxkygQ Next: Dvf51PW6mkNaHTtXSpRgUTmqLE2HYQy9zyakZXzpTntz Diff:
Old | New | Differences | |
---|---|---|---|
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let delayBlock = 1 | |
5 | 5 | ||
6 | - | let minPayment = | |
6 | + | let minPayment = 100000000 | |
7 | 7 | ||
8 | 8 | let acceptableAssetId = base58'GQqJPRuXvxoyz22DeLqquGcx3cdbYpWi6QdqfQUMbLuf' | |
9 | + | ||
10 | + | let msgPagamento = ((("Devi effettuare un pagamento in " + toBase58String(acceptableAssetId)) + " di almeno ") + toString(minPayment)) | |
9 | 11 | ||
10 | 12 | let fieldNameRisultato = "seme_estratto" | |
11 | 13 | ||
32 | 34 | let fieldNameProvider = "provider" | |
33 | 35 | ||
34 | 36 | func isPaymentOk (i) = if ((size(i.payments) == 0)) | |
35 | - | then throw( | |
37 | + | then throw(msgPagamento) | |
36 | 38 | else { | |
37 | 39 | let p = i.payments[0] | |
38 | 40 | match p.assetId { | |
187 | 189 | @Callable(i) | |
188 | 190 | func registra (richiesta,cardinalita,estrazioni) = if (isPaymentOk(i)) | |
189 | 191 | then registra1(richiesta, cardinalita, estrazioni, i) | |
190 | - | else throw( | |
192 | + | else throw(msgPagamento) | |
191 | 193 | ||
192 | 194 |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 5 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let delayBlock = 1 | |
5 | 5 | ||
6 | - | let minPayment = | |
6 | + | let minPayment = 100000000 | |
7 | 7 | ||
8 | 8 | let acceptableAssetId = base58'GQqJPRuXvxoyz22DeLqquGcx3cdbYpWi6QdqfQUMbLuf' | |
9 | + | ||
10 | + | let msgPagamento = ((("Devi effettuare un pagamento in " + toBase58String(acceptableAssetId)) + " di almeno ") + toString(minPayment)) | |
9 | 11 | ||
10 | 12 | let fieldNameRisultato = "seme_estratto" | |
11 | 13 | ||
12 | 14 | let fieldNameSeed = "seed" | |
13 | 15 | ||
14 | 16 | let fieldNameSeedB16 = "seed_b16" | |
15 | 17 | ||
16 | 18 | let fieldNameHeightExtraction = "height_extraction" | |
17 | 19 | ||
18 | 20 | let fieldNameJson = "json" | |
19 | 21 | ||
20 | 22 | let fieldNameCardinalita = "cardinalita" | |
21 | 23 | ||
22 | 24 | let fieldNameDataRichiesta = "data_richiesta" | |
23 | 25 | ||
24 | 26 | let fieldNameEstrazioni = "estrazioni" | |
25 | 27 | ||
26 | 28 | let fieldNameRichiesta = "richiesta" | |
27 | 29 | ||
28 | 30 | let fieldNameCounter = "counter" | |
29 | 31 | ||
30 | 32 | let fieldNameIdCounter = "id_richiesta" | |
31 | 33 | ||
32 | 34 | let fieldNameProvider = "provider" | |
33 | 35 | ||
34 | 36 | func isPaymentOk (i) = if ((size(i.payments) == 0)) | |
35 | - | then throw( | |
37 | + | then throw(msgPagamento) | |
36 | 38 | else { | |
37 | 39 | let p = i.payments[0] | |
38 | 40 | match p.assetId { | |
39 | 41 | case a: ByteVector => | |
40 | 42 | if ((a == acceptableAssetId)) | |
41 | 43 | then (p.amount >= minPayment) | |
42 | 44 | else false | |
43 | 45 | case _ => | |
44 | 46 | false | |
45 | 47 | } | |
46 | 48 | } | |
47 | 49 | ||
48 | 50 | ||
49 | 51 | func openJson (key,value) = ((("{\"" + key) + "\":\"") + value) | |
50 | 52 | ||
51 | 53 | ||
52 | 54 | func addJson (key,value) = ((("\", \"" + key) + "\":\" ") + value) | |
53 | 55 | ||
54 | 56 | ||
55 | 57 | func closeJson (key,value) = (((("\", \"" + key) + "\":\" ") + value) + "\"}") | |
56 | 58 | ||
57 | 59 | ||
58 | 60 | func myGetInt (key,msg) = { | |
59 | 61 | let myInt = match getInteger(this, key) { | |
60 | 62 | case t: Int => | |
61 | 63 | t | |
62 | 64 | case _ => | |
63 | 65 | throw(msg) | |
64 | 66 | } | |
65 | 67 | myInt | |
66 | 68 | } | |
67 | 69 | ||
68 | 70 | ||
69 | 71 | func getCurrentBlock () = { | |
70 | 72 | let block = match blockInfoByHeight(height) { | |
71 | 73 | case x: BlockInfo => | |
72 | 74 | x | |
73 | 75 | case _ => | |
74 | 76 | throw("Alla ricerca del blocco corrente: Blocco non trovato!") | |
75 | 77 | } | |
76 | 78 | block | |
77 | 79 | } | |
78 | 80 | ||
79 | 81 | ||
80 | 82 | func getTimestamp () = { | |
81 | 83 | let block = match blockInfoByHeight(height) { | |
82 | 84 | case x: BlockInfo => | |
83 | 85 | x.timestamp | |
84 | 86 | case _ => | |
85 | 87 | throw("Alla ricerca del `timestamp`: Blocco non trovato!") | |
86 | 88 | } | |
87 | 89 | block | |
88 | 90 | } | |
89 | 91 | ||
90 | 92 | ||
91 | 93 | func getVrf (thisBlock) = { | |
92 | 94 | let vrf = match thisBlock.vrf { | |
93 | 95 | case t: ByteVector => | |
94 | 96 | t | |
95 | 97 | case _ => | |
96 | 98 | throw("Alla ricerca del `vrf`: Blocco non trovato o blocco non in versione 5 ritenta.") | |
97 | 99 | } | |
98 | 100 | vrf | |
99 | 101 | } | |
100 | 102 | ||
101 | 103 | ||
102 | 104 | func randomizer (inv) = { | |
103 | 105 | let currentBlock = getCurrentBlock() | |
104 | 106 | let rand = (((((inv.transactionId + inv.callerPublicKey) + getVrf(currentBlock)) + currentBlock.generationSignature) + toBytes(currentBlock.timestamp)) + toBytes(currentBlock.height)) | |
105 | 107 | sha256_16Kb(sha256_16Kb(rand)) | |
106 | 108 | } | |
107 | 109 | ||
108 | 110 | ||
109 | 111 | func estrai1 (richiesta,numero,i) = { | |
110 | 112 | let strOwnerAddress = toString(i.caller) | |
111 | 113 | let keyPrefix = (((strOwnerAddress + "_") + richiesta) + "_") | |
112 | 114 | let keyCounter = (keyPrefix + fieldNameCounter) | |
113 | 115 | let maxRichiesta = myGetInt(keyCounter, "La richiesta fatta non è stata ancora registrata") | |
114 | 116 | let numeroRichiesta = if ((0 >= numero)) | |
115 | 117 | then maxRichiesta | |
116 | 118 | else if ((maxRichiesta >= numero)) | |
117 | 119 | then numero | |
118 | 120 | else throw("Non esiste una richiesta con questo numero") | |
119 | 121 | let keyPrefixN = ((keyPrefix + toString(numeroRichiesta)) + "_") | |
120 | 122 | let keyRisultato = (keyPrefixN + fieldNameRisultato) | |
121 | 123 | let isEstratto = match getString(this, keyRisultato) { | |
122 | 124 | case t: String => | |
123 | 125 | throw(((("Risultato già presente in blockchain: " + keyRisultato) + ": ") + t)) | |
124 | 126 | case _ => | |
125 | 127 | false | |
126 | 128 | } | |
127 | 129 | if (!(isEstratto)) | |
128 | 130 | then { | |
129 | 131 | let heightBloccoCandidato = myGetInt((keyPrefixN + fieldNameHeightExtraction), "Errore generico su dati della richiesta") | |
130 | 132 | if ((heightBloccoCandidato > height)) | |
131 | 133 | then throw(((("Devi aspettare il blocco " + toString(heightBloccoCandidato)) + ". siamo al blocco ") + toString(height))) | |
132 | 134 | else { | |
133 | 135 | let keySeme = (keyPrefixN + fieldNameSeed) | |
134 | 136 | let seed = match getBinary(this, keySeme) { | |
135 | 137 | case t: ByteVector => | |
136 | 138 | t | |
137 | 139 | case _ => | |
138 | 140 | throw("Seme non trovato. Qualcosa è andata storta!") | |
139 | 141 | } | |
140 | 142 | let bloccoCandidato = match blockInfoByHeight(heightBloccoCandidato) { | |
141 | 143 | case block: BlockInfo => | |
142 | 144 | block | |
143 | 145 | case _ => | |
144 | 146 | throw("Errore: Il blocco di estrazione non esiste") | |
145 | 147 | } | |
146 | 148 | let vrfValue = match bloccoCandidato.vrf { | |
147 | 149 | case t: ByteVector => | |
148 | 150 | t | |
149 | 151 | case _ => | |
150 | 152 | throw("Blocco non in versione 5 ritenta.") | |
151 | 153 | } | |
152 | 154 | let rand = (((seed + bloccoCandidato.generationSignature) + bloccoCandidato.generatorPublicKey) + getVrf(bloccoCandidato)) | |
153 | 155 | let sha = toBase16String(sha256_16Kb(sha256_16Kb(rand))) | |
154 | 156 | let strCardinalita = toString(myGetInt((keyPrefixN + fieldNameCardinalita), "Errore lettura cardinalità")) | |
155 | 157 | let strDataRichiesta = toString(myGetInt((keyPrefixN + fieldNameDataRichiesta), "Errore lettura DataRichiesta")) | |
156 | 158 | let strEstrazioni = toString(myGetInt((keyPrefixN + fieldNameEstrazioni), "Errore lettura Estrazioni")) | |
157 | 159 | let json = (((((((((openJson(fieldNameIdCounter, toString(numeroRichiesta)) + addJson(fieldNameCounter, toString(maxRichiesta))) + addJson(fieldNameProvider, strOwnerAddress)) + addJson(fieldNameRichiesta, richiesta)) + addJson(fieldNameCardinalita, strCardinalita)) + addJson(fieldNameEstrazioni, strEstrazioni)) + addJson(fieldNameDataRichiesta, strDataRichiesta)) + addJson(fieldNameSeedB16, toBase16String(seed))) + addJson(fieldNameHeightExtraction, toString(heightBloccoCandidato))) + closeJson(fieldNameRisultato, sha)) | |
158 | 160 | [StringEntry((keyPrefixN + fieldNameJson), json), StringEntry(keyRisultato, sha)] | |
159 | 161 | } | |
160 | 162 | } | |
161 | 163 | else throw("Errore: non dovresti passare da quì") | |
162 | 164 | } | |
163 | 165 | ||
164 | 166 | ||
165 | 167 | func registra1 (richiesta,cardinalita,estrazioni,i) = { | |
166 | 168 | let keyPrefix = (((toString(i.caller) + "_") + richiesta) + "_") | |
167 | 169 | let keyCounter = (keyPrefix + fieldNameCounter) | |
168 | 170 | let nRichiesta = match getInteger(this, keyCounter) { | |
169 | 171 | case c: Int => | |
170 | 172 | (c + 1) | |
171 | 173 | case _ => | |
172 | 174 | 1 | |
173 | 175 | } | |
174 | 176 | let keyPrefixN = ((keyPrefix + toString(nRichiesta)) + "_") | |
175 | 177 | let seed = randomizer(i) | |
176 | 178 | let currDate = getTimestamp() | |
177 | 179 | let heightExtraction = (height + delayBlock) | |
178 | 180 | [IntegerEntry(keyCounter, nRichiesta), IntegerEntry((keyPrefixN + fieldNameHeightExtraction), heightExtraction), IntegerEntry((keyPrefixN + fieldNameCardinalita), cardinalita), IntegerEntry((keyPrefixN + fieldNameEstrazioni), estrazioni), IntegerEntry((keyPrefixN + fieldNameDataRichiesta), currDate), BinaryEntry((keyPrefixN + fieldNameSeed), seed), StringEntry((keyPrefixN + fieldNameSeedB16), toBase16String(seed)), StringEntry((keyPrefixN + fieldNameRichiesta), richiesta)] | |
179 | 181 | } | |
180 | 182 | ||
181 | 183 | ||
182 | 184 | @Callable(i) | |
183 | 185 | func estrai (richiesta,numero) = estrai1(richiesta, numero, i) | |
184 | 186 | ||
185 | 187 | ||
186 | 188 | ||
187 | 189 | @Callable(i) | |
188 | 190 | func registra (richiesta,cardinalita,estrazioni) = if (isPaymentOk(i)) | |
189 | 191 | then registra1(richiesta, cardinalita, estrazioni, i) | |
190 | - | else throw( | |
192 | + | else throw(msgPagamento) | |
191 | 193 | ||
192 | 194 |
github/deemru/w8io/169f3d6 43.26 ms ◑