tx · H5ME1UH6gzgR9osALhakoc5TRBWvyLcoHBEcVwgQvfQt 3N8y4wxX3JC4TdrCJBXX16SjWf6X256hrep: -0.01000000 Waves 2022.11.18 14:27 [2322493] smart account 3N8y4wxX3JC4TdrCJBXX16SjWf6X256hrep > SELF 0.00000000 Waves
{ "type": 13, "id": "H5ME1UH6gzgR9osALhakoc5TRBWvyLcoHBEcVwgQvfQt", "fee": 1000000, "feeAssetId": null, "timestamp": 1668770910514, "version": 2, "chainId": 84, "sender": "3N8y4wxX3JC4TdrCJBXX16SjWf6X256hrep", "senderPublicKey": "7v5L7QkXxfkirALdyqmox38QCsa9jtfAtgUfHTh34eWq", "proofs": [ "4P1x1gZnQcfinWHXXuTEDXtaozCQuEWVxyJmBZoS9ts3H5XstrQvEjefxpHFHdpRGBmMbVan4XAd2szBGDxgizHt" ], "script": "base64:BgIJCAISBQoDCAgYCQAFTVVMVDYAwIQ9AAt1c2RuQXNzZXRJZAEg93bq9/eDymXbbhPuAjvPWCmVqcHRjfJL2mzYHWKAyN4AC2JhY2tFbmRBZGRyCQERQGV4dHJOYXRpdmUoMTA2MikBAiMzTjVTcFgyMVIzUjc1UW80ZWIzTXdGRnZXN1RVenlodmF2dgAQYWxsb3dlZFJlc291cmNlcwkAzAgCAgNPaWwJAMwIAgIDT3JlCQDMCAICBFdvb2QJAMwIAgIEU2FuZAkAzAgCAgRDbGF5CQDMCAICB09yZ2FuaWMFA25pbAAKY29udGluZW50cwkAzAgCAghBbWVyaWNhcwkAzAgCAgZFdXJvcGUJAMwIAgIEQXNpYQkAzAgCAgZBZnJpY2EJAMwIAgIHT2NlYW5pYQUDbmlsAR1rZXlTdG9yZVJlc0J5Q29udGluZW50QW5kVHlwZQIJY29udGluZW50B3Jlc1R5cGUJAKwCAgkArAICCQCsAgICIHN0b3JlUmVzb3VyY2VCeUNvbnRpbmVudEFuZFR5cGVfBQljb250aW5lbnQCAV8FB3Jlc1R5cGUAB2lkeFR5cGUAAAALaWR4UXVhbnRpd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CBQNuaWwAAAoBBSRmMF8xAgIkYQIkaQMJAGcCBQIkaQUCJHMFAiRhCQEFYWRkZXICBQIkYQkAkQMCBQIkbAUCJGkKAQUkZjBfMgICJGECJGkDCQBnAgUCJGkFAiRzBQIkYQkAAgECFExpc3Qgc2l6ZSBleGNlZWRzIDEwCQEFJGYwXzICCQEFJGYwXzECCQEFJGYwXzECCQEFJGYwXzECCQEFJGYwXzECCQEFJGYwXzECCQEFJGYwXzECCQEFJGYwXzECCQEFJGYwXzECCQEFJGYwXzECCQEFJGYwXzECBQUkYWNjMAAAAAEAAgADAAQABQAGAAcACAAJAAoJAM0IAggFBnJlc3VsdAJfMQkBDlNjcmlwdFRyYW5zZmVyAwULdXNlckFkZHJlc3MIBQZyZXN1bHQCXzIFC3VzZG5Bc3NldElkAI1PREM=", "height": 2322493, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: none Next: 2LmFCPKDWAxPQVWtiko78HQLF3RFmvWbzCSLYKGdTWK9 Full:
Old | New | Differences | |
---|---|---|---|
1 | - | # no script | |
1 | + | {-# STDLIB_VERSION 6 #-} | |
2 | + | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | + | {-# CONTENT_TYPE DAPP #-} | |
4 | + | let a = 1000000 | |
5 | + | ||
6 | + | let b = base58'HezsdQuRDtzksAYUy97gfhKy7Z1NW2uXYSHA3bgqenNZ' | |
7 | + | ||
8 | + | let c = addressFromStringValue("3N5SpX21R3R75Qo4eb3MwFFvW7TUzyhvavv") | |
9 | + | ||
10 | + | let d = ["Oil", "Ore", "Wood", "Sand", "Clay", "Organic"] | |
11 | + | ||
12 | + | let e = ["Americas", "Europe", "Asia", "Africa", "Oceania"] | |
13 | + | ||
14 | + | func f (g,h) = ((("storeResourceByContinentAndType_" + g) + "_") + h) | |
15 | + | ||
16 | + | ||
17 | + | let i = 0 | |
18 | + | ||
19 | + | let j = 1 | |
20 | + | ||
21 | + | let k = 2 | |
22 | + | ||
23 | + | @Callable(l) | |
24 | + | func sellResources (m,g,n) = if ((l.caller != c)) | |
25 | + | then throw("permission denied") | |
26 | + | else if ((size(l.payments) != 0)) | |
27 | + | then throw("sellResources doesn't require any payments") | |
28 | + | else if (!(containsElement(e, g))) | |
29 | + | then throw(("Unknown continent: " + g)) | |
30 | + | else { | |
31 | + | let o = addressFromStringValue(m) | |
32 | + | func p (q,r) = { | |
33 | + | let s = split(r, "_") | |
34 | + | let h = s[i] | |
35 | + | if (!(containsElement(d, h))) | |
36 | + | then throw(("Unknown resource: " + h)) | |
37 | + | else { | |
38 | + | let t = f(g, h) | |
39 | + | let u = valueOrElse(getInteger(t), 0) | |
40 | + | let v = parseIntValue(s[j]) | |
41 | + | $Tuple2((q._1 :+ IntegerEntry(t, v)), (q._2 + fraction(v, parseIntValue(s[k]), a))) | |
42 | + | } | |
43 | + | } | |
44 | + | ||
45 | + | let w = { | |
46 | + | let x = n | |
47 | + | let y = size(x) | |
48 | + | let z = $Tuple2(nil, 0) | |
49 | + | func A (B,C) = if ((C >= y)) | |
50 | + | then B | |
51 | + | else p(B, x[C]) | |
52 | + | ||
53 | + | func D (B,C) = if ((C >= y)) | |
54 | + | then B | |
55 | + | else throw("List size exceeds 10") | |
56 | + | ||
57 | + | D(A(A(A(A(A(A(A(A(A(A(z, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10) | |
58 | + | } | |
59 | + | (w._1 :+ ScriptTransfer(o, w._2, b)) | |
60 | + | } | |
61 | + | ||
62 | + |
github/deemru/w8io/026f985 20.01 ms ◑