tx · DaAdLE1piJi4mhdZybbk3vALHm1owdBuyLEW5d9mh1V7 3MzcHAM4DcpYKt1ZAMibQmqU69pKQ6qz3i4: -0.00200000 Waves 2023.03.26 00:39 [2506075] smart account 3MzcHAM4DcpYKt1ZAMibQmqU69pKQ6qz3i4 > SELF 0.00000000 Waves
{ "type": 13, "id": "DaAdLE1piJi4mhdZybbk3vALHm1owdBuyLEW5d9mh1V7", "fee": 200000, "feeAssetId": null, "timestamp": 1679780393154, "version": 2, "chainId": 84, "sender": "3MzcHAM4DcpYKt1ZAMibQmqU69pKQ6qz3i4", "senderPublicKey": "DoAid1WtwHRuonKq6xKkbxijk1QQhXG75vdyuUM7n7NN", "proofs": [ "2pqEzAnT2YuAN3os7hbeTeFnNGdoWJnLANJ1ZUAjFMJSjaZjTcWFy1bWH2CgVrChgFNiuPGHUu9PuTUfikb68FhT" ], "script": "base64:BgIKCAISBAoCCAgSABIABmFkbWluMQIsRjF5akRkaG9XY3RHUDl5bUdyQmtUZE5IbUVmUHF2TXRpQ0ZYbU43aVhOZ3IABmFkbWluMgIAAApwdXp6bGVNaW50AiMzUEZRampETWlaS1FaZHU1SnFUSEQ3SHdnU1h5cDlSdzlCeQAWa2V5X2Zhcm1OZnRfbmV4dE51bWJlcgISZmFybU5mdF9uZXh0TnVtYmVyABBrZXlfZmFybU5mdF9uYW1lAgxmYXJtTmZ0X25hbWUAF2tleV9mYXJtTmZ0X2Rlc2NyaXB0aW9uAhNmYXJtTmZ0X2Rlc2NyaXB0aW9uABZrZXlfZmFybU5mdF9jb2xsZWN0aW9uAhJmYXJtTmZ0X2NvbGxlY3Rpb24AEWtleV9mYXJtTmZ0X2ltYWdlAg1mYXJtTmZ0X2ltYWdlAA9rZXlfY293TmZ0X25hbWUCC2Nvd05mdF9uYW1lABZrZXlfY293TmZ0X2Rlc2NyaXB0aW9uAhJjb3dOZnRfZGVzY3JpcHRpb24AFWtleV9jb3dOZnRfY29sbGVjdGlvbgIRY293TmZ0X2NvbGxlY3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5mdERlc2NyaXB0aW9uAAEAAAcEAmlkCQC4CAEFBWlzc3VlCQCUCgIJAMwIAgUFaXNzdWUJAMwIAgkBDlNjcmlwdFRyYW5zZmVyAwUJcmVjaXBpZW50AAEFAmlkCQDMCAIJAQxJbnRlZ2VyRW50cnkCBRZrZXlfZmFybU5mdF9uZXh0TnVtYmVyCQBkAgUHbmV4dE51bQABCQDMCAIJAQxCb29sZWFuRW50cnkCCQCsAgIJAKwCAgIFZmFybV8FB2FkZHJlc3MCB19zdGF0dXMGCQDMCAIJAQtTdHJpbmdFbnRyeQIJAKwCAgkArAICAgVmYXJtXwUHYWRkcmVzcwIFX25hbWUFCGZhcm1OYW1lCQDMCAIJAQtTdHJpbmdFbnRyeQIJAKwCAgkArAICAgVmYXJtXwUHYWRkcmVzcwIJX2xvY2F0aW9uBQxmYXJtTG9jYXRpb24FA25pbAkAlQoDBQduZXh0TnVtBQhmYXJtTmFtZQUMZmFybUxvY2F0aW9uCQACAQIkU3RyaWN0IHZhbHVlIGlzIG5vdCBlcXVhbCB0byBpdHNlbGYuCQACAQISTm90IGFsbG93ZWQgY2FsbGVyAWkBBGluaXQABAljYWxsZXJQYmsJANgEAQgFAWkPY2FsbGVyUHVibGljS2V5AwkBBWFsbG93AQUJY2FsbGVyUGJrBAduZXh0TnVtCQENdHJ5R2V0SW50ZWdlcgEFFmtleV9mYXJtTmZ0X25leHROdW1iZXIDCQECIT0CBQduZXh0TnVtAAAJAAIBAh9Db250cmFjdCBpcyBhbHJlYWR5IGluaXRpYWxpemVkCQDMCAIJAQxJbnRlZ2VyRW50cnkCBRZrZXlfZmFybU5mdF9uZXh0TnVtYmVyAAEFA25pbAkAAgECEk5vdCBhbGxvd2VkIGNhbGxlcgBqy5tG", "height": 2506075, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 6VwaZBNge2Ak9cAyudwShLrkKDHLhDhWW9kkpma6qomA Next: 8mvjCJpdqrjTbXqXWgADL3k8PhTEu1FiiHkcPWyUMJk9 Diff:
Old | New | Differences | |
---|---|---|---|
65 | 65 | let w = toBase58String(x.callerPublicKey) | |
66 | 66 | if (v(w)) | |
67 | 67 | then { | |
68 | - | let A = addressFromStringValue( | |
68 | + | let A = addressFromStringValue(y) | |
69 | 69 | let B = split_4C(z, "|") | |
70 | 70 | let C = $Tuple2(B[0], B[1]) | |
71 | 71 | let D = C._1 | |
75 | 75 | then { | |
76 | 76 | let G = (t(e) + toString(F)) | |
77 | 77 | let H = t(f) | |
78 | - | let I = t(g) | |
79 | - | let J = t(h) | |
80 | - | let K = { | |
81 | - | let L = invoke(addressFromStringValue(c), "mint", [G, H, I, J, J, 1, "", "", ""], nil) | |
82 | - | if ($isInstanceOf(L, "String")) | |
83 | - | then L | |
84 | - | else throw(($getType(L) + " couldn't be cast to String")) | |
85 | - | } | |
86 | - | if ((K == K)) | |
87 | - | then $Tuple2([ScriptTransfer(A, 1, fromBase58String(K)), IntegerEntry(d, (F + 1)), BooleanEntry((("farm_" + y) + "_status"), true), StringEntry((("farm_" + y) + "_name"), D), StringEntry((("farm_" + y) + "_location"), E)], $Tuple3(F, D, E)) | |
88 | - | else throw("Strict value is not equal to itself.") | |
78 | + | let I = Issue(G, H, 1, 0, false) | |
79 | + | let J = calculateAssetId(I) | |
80 | + | $Tuple2([I, ScriptTransfer(A, 1, J), IntegerEntry(d, (F + 1)), BooleanEntry((("farm_" + y) + "_status"), true), StringEntry((("farm_" + y) + "_name"), D), StringEntry((("farm_" + y) + "_location"), E)], $Tuple3(F, D, E)) | |
89 | 81 | } | |
90 | 82 | else throw("Strict value is not equal to itself.") | |
91 | 83 | } | |
92 | 84 | else throw("Not allowed caller") | |
93 | 85 | } | |
94 | - | ||
95 | - | ||
96 | - | ||
97 | - | @Callable(x) | |
98 | - | func test () = { | |
99 | - | let M = { | |
100 | - | let L = invoke(this, "mint", nil, nil) | |
101 | - | if ($isInstanceOf(L, "String")) | |
102 | - | then L | |
103 | - | else throw(($getType(L) + " couldn't be cast to String")) | |
104 | - | } | |
105 | - | if ((M == M)) | |
106 | - | then if (true) | |
107 | - | then throw(M) | |
108 | - | else nil | |
109 | - | else throw("Strict value is not equal to itself.") | |
110 | - | } | |
111 | - | ||
112 | - | ||
113 | - | ||
114 | - | @Callable(x) | |
115 | - | func mint () = $Tuple2(nil, 42) | |
116 | 86 | ||
117 | 87 | ||
118 | 88 |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 6 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let a = "F1yjDdhoWctGP9ymGrBkTdNHmEfPqvMtiCFXmN7iXNgr" | |
5 | 5 | ||
6 | 6 | let b = "" | |
7 | 7 | ||
8 | 8 | let c = "3PFQjjDMiZKQZdu5JqTHD7HwgSXyp9Rw9By" | |
9 | 9 | ||
10 | 10 | let d = "farmNft_nextNumber" | |
11 | 11 | ||
12 | 12 | let e = "farmNft_name" | |
13 | 13 | ||
14 | 14 | let f = "farmNft_description" | |
15 | 15 | ||
16 | 16 | let g = "farmNft_collection" | |
17 | 17 | ||
18 | 18 | let h = "farmNft_image" | |
19 | 19 | ||
20 | 20 | let i = "cowNft_name" | |
21 | 21 | ||
22 | 22 | let j = "cowNft_description" | |
23 | 23 | ||
24 | 24 | let k = "cowNft_collection" | |
25 | 25 | ||
26 | 26 | let l = "cowNft_image" | |
27 | 27 | ||
28 | 28 | let m = "ACTIVE" | |
29 | 29 | ||
30 | 30 | let n = "INACTIVE" | |
31 | 31 | ||
32 | 32 | let o = "FATTEN" | |
33 | 33 | ||
34 | 34 | func p (q) = { | |
35 | 35 | let r = getInteger(this, q) | |
36 | 36 | if ($isInstanceOf(r, "Int")) | |
37 | 37 | then { | |
38 | 38 | let s = r | |
39 | 39 | s | |
40 | 40 | } | |
41 | 41 | else 0 | |
42 | 42 | } | |
43 | 43 | ||
44 | 44 | ||
45 | 45 | func t (q) = { | |
46 | 46 | let r = getString(this, q) | |
47 | 47 | if ($isInstanceOf(r, "String")) | |
48 | 48 | then { | |
49 | 49 | let u = r | |
50 | 50 | u | |
51 | 51 | } | |
52 | 52 | else "" | |
53 | 53 | } | |
54 | 54 | ||
55 | 55 | ||
56 | 56 | func v (w) = if (if ((w == a)) | |
57 | 57 | then true | |
58 | 58 | else (w == b)) | |
59 | 59 | then true | |
60 | 60 | else false | |
61 | 61 | ||
62 | 62 | ||
63 | 63 | @Callable(x) | |
64 | 64 | func registerFarm (y,z) = { | |
65 | 65 | let w = toBase58String(x.callerPublicKey) | |
66 | 66 | if (v(w)) | |
67 | 67 | then { | |
68 | - | let A = addressFromStringValue( | |
68 | + | let A = addressFromStringValue(y) | |
69 | 69 | let B = split_4C(z, "|") | |
70 | 70 | let C = $Tuple2(B[0], B[1]) | |
71 | 71 | let D = C._1 | |
72 | 72 | let E = C._2 | |
73 | 73 | let F = p(d) | |
74 | 74 | if ((F == F)) | |
75 | 75 | then { | |
76 | 76 | let G = (t(e) + toString(F)) | |
77 | 77 | let H = t(f) | |
78 | - | let I = t(g) | |
79 | - | let J = t(h) | |
80 | - | let K = { | |
81 | - | let L = invoke(addressFromStringValue(c), "mint", [G, H, I, J, J, 1, "", "", ""], nil) | |
82 | - | if ($isInstanceOf(L, "String")) | |
83 | - | then L | |
84 | - | else throw(($getType(L) + " couldn't be cast to String")) | |
85 | - | } | |
86 | - | if ((K == K)) | |
87 | - | then $Tuple2([ScriptTransfer(A, 1, fromBase58String(K)), IntegerEntry(d, (F + 1)), BooleanEntry((("farm_" + y) + "_status"), true), StringEntry((("farm_" + y) + "_name"), D), StringEntry((("farm_" + y) + "_location"), E)], $Tuple3(F, D, E)) | |
88 | - | else throw("Strict value is not equal to itself.") | |
78 | + | let I = Issue(G, H, 1, 0, false) | |
79 | + | let J = calculateAssetId(I) | |
80 | + | $Tuple2([I, ScriptTransfer(A, 1, J), IntegerEntry(d, (F + 1)), BooleanEntry((("farm_" + y) + "_status"), true), StringEntry((("farm_" + y) + "_name"), D), StringEntry((("farm_" + y) + "_location"), E)], $Tuple3(F, D, E)) | |
89 | 81 | } | |
90 | 82 | else throw("Strict value is not equal to itself.") | |
91 | 83 | } | |
92 | 84 | else throw("Not allowed caller") | |
93 | 85 | } | |
94 | - | ||
95 | - | ||
96 | - | ||
97 | - | @Callable(x) | |
98 | - | func test () = { | |
99 | - | let M = { | |
100 | - | let L = invoke(this, "mint", nil, nil) | |
101 | - | if ($isInstanceOf(L, "String")) | |
102 | - | then L | |
103 | - | else throw(($getType(L) + " couldn't be cast to String")) | |
104 | - | } | |
105 | - | if ((M == M)) | |
106 | - | then if (true) | |
107 | - | then throw(M) | |
108 | - | else nil | |
109 | - | else throw("Strict value is not equal to itself.") | |
110 | - | } | |
111 | - | ||
112 | - | ||
113 | - | ||
114 | - | @Callable(x) | |
115 | - | func mint () = $Tuple2(nil, 42) | |
116 | 86 | ||
117 | 87 | ||
118 | 88 | ||
119 | 89 | @Callable(x) | |
120 | 90 | func init () = { | |
121 | 91 | let w = toBase58String(x.callerPublicKey) | |
122 | 92 | if (v(w)) | |
123 | 93 | then { | |
124 | 94 | let F = p(d) | |
125 | 95 | if ((F != 0)) | |
126 | 96 | then throw("Contract is already initialized") | |
127 | 97 | else [IntegerEntry(d, 1)] | |
128 | 98 | } | |
129 | 99 | else throw("Not allowed caller") | |
130 | 100 | } | |
131 | 101 | ||
132 | 102 |
github/deemru/w8io/026f985 39.37 ms ◑