tx · BDcyKXf3MJzSqnzkYmWdgaH6c7qmyMdp9U2hruiE2hMd 3MzcHAM4DcpYKt1ZAMibQmqU69pKQ6qz3i4: -0.00300000 Waves 2023.03.24 02:01 [2503284] smart account 3MzcHAM4DcpYKt1ZAMibQmqU69pKQ6qz3i4 > SELF 0.00000000 Waves
{ "type": 13, "id": "BDcyKXf3MJzSqnzkYmWdgaH6c7qmyMdp9U2hruiE2hMd", "fee": 300000, "feeAssetId": null, "timestamp": 1679612541323, "version": 2, "chainId": 84, "sender": "3MzcHAM4DcpYKt1ZAMibQmqU69pKQ6qz3i4", "senderPublicKey": "DoAid1WtwHRuonKq6xKkbxijk1QQhXG75vdyuUM7n7NN", "proofs": [ "5fkVdQJdquP5QymKTiM86k7jP8GbN7H1pfCPHacUxBps5tRhGDHdjudzZhRmuH9FCc5iEfB1DjHutLRvTiqFPraV" ], "script": "base64:BgIQCAISBAoCCAgSBAoCCAgSAAwABmFkbWluMQIsQmd4cENtNHd4Ylc4U0tMUEtabmY0S1UyRDZaVTI5b3Y4TWdacmthU0FxcFkABmFkbWluMgIAABZrZXlfZmFybU5mdF9uZXh0TnVtYmVyAhJmYXJtTmZ0X25leHROdW1iZXIADGZhcm1OZnRfbmFtZQIKQ2F0dGxlIE5GVAALY293TmZ0X25hbWUCB0NvdyBORlQAE2Zhcm1OZnRfZGVzY3JpcHRpb24CC3siaW1hZ2UiOiAiAARsaXZlAgZBQ1RJVkUABGRlYWQCCElOQUNUSVZFAAZmYXR0ZW4CBkZBVFRFTgENdHJ5R2V0SW50ZWdlcgEDa2V5BAckbWF0Y2gwCQCaCAIFBHRoaXMFA2tleQMJAAECBQckbWF0Y2gwAgNJbnQEAWIFByRtYXRjaDAFAWIAAAEMdHJ5R2V0U3RyaW5nAQNrZXkEByRtYXRjaDAJAJ0IAgUEdGhpcwUDa2V5AwkAAQIFByRtYXRjaDACBlN0cmluZwQBYQUHJG1hdGNoMAUBYQIAAQVhbGxvdwEJY2FsbGVyUGJrBgMBa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rAgEiBAVpc3N1ZQkAwggFBQtjb3dOZnRfbmFtZQkArAICCQCsAgIFC2Rlc2NyaXB0aW9uBQlpbWFnZUxpbmsCAiJ9AAEAAAcEAmlkCQC4CAEFBWlzc3VlCQDMCAIFBWlzc3VlCQDMCAIJAQ5TY3JpcHRUcmFuc2ZlcgMFCXJlY2lwaWVudAABBQJpZAkAzAgCCQELU3RyaW5nRW50cnkCCQCsAgIJAKwCAgkArAICCQCsAgICBWZhcm1fBQdhZGRyZXNzAgVfY293XwkA2AQBBQJpZAIHX3N0YXR1cwUEbGl2ZQkAzAgCCQELU3RyaW5nRW50cnkCCQCsAgIJAKwCAgIEY293XwkA2AQBBQJpZAIGX293bmVyBQdhZGRyZXNzBQNuaWwJAAIBAhJOb3QgYWxsb3dlZCBjYWxsZXIBaQEEaW5pdAAECWNhbGxlclBiawkA2AQBCAUBaQ9jYWxsZXJQdWJsaWNLZXkDCQEFYWxsb3cBBQljYWxsZXJQYmsJAMwIAgkBDEludGVnZXJFbnRyeQIFFmtleV9mYXJtTmZ0X25leHROdW1iZXIAAQUDbmlsCQACAQISTm90IGFsbG93ZWQgY2FsbGVyABuLCJU=", "height": 2503284, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: EBat6D5etJp3WYMzddKmtw3GxwvG6EvFehM65S7uf3LP Next: 1GMcigNkntC3S77F8Afko6jPHbzLYYheVw7WWfY8pTB Diff:
Old | New | Differences | |
---|---|---|---|
35 | 35 | } | |
36 | 36 | ||
37 | 37 | ||
38 | - | func allow (callerPbk) = if (if ((callerPbk == admin1)) | |
39 | - | then true | |
40 | - | else (callerPbk == admin2)) | |
41 | - | then true | |
42 | - | else false | |
38 | + | func allow (callerPbk) = true | |
43 | 39 | ||
44 | 40 | ||
45 | 41 | @Callable(i) | |
49 | 45 | then { | |
50 | 46 | let recipient = addressFromStringValue(address) | |
51 | 47 | let p_arr = split_4C(params, "|") | |
52 | - | let $ | |
53 | - | let farmName = $ | |
54 | - | let farmLocation = $ | |
55 | - | let imageLink = $ | |
48 | + | let $t014911563 = $Tuple3(p_arr[0], p_arr[1], p_arr[2]) | |
49 | + | let farmName = $t014911563._1 | |
50 | + | let farmLocation = $t014911563._2 | |
51 | + | let imageLink = $t014911563._3 | |
56 | 52 | let nextNum = tryGetInteger(key_farmNft_nextNumber) | |
57 | 53 | if ((nextNum == nextNum)) | |
58 | 54 | then { | |
74 | 70 | then { | |
75 | 71 | let recipient = addressFromStringValue(address) | |
76 | 72 | let p_arr = split_4C(params, params) | |
77 | - | let $ | |
78 | - | let cowCode = $ | |
79 | - | let bornedFarmAddress = $ | |
80 | - | let genes = $ | |
81 | - | let motherId = $ | |
82 | - | let fatherId = $ | |
83 | - | let type = $ | |
84 | - | let imageLink = $ | |
73 | + | let $t026302779 = $Tuple7(p_arr[0], p_arr[1], p_arr[2], p_arr[3], p_arr[4], p_arr[5], p_arr[6]) | |
74 | + | let cowCode = $t026302779._1 | |
75 | + | let bornedFarmAddress = $t026302779._2 | |
76 | + | let genes = $t026302779._3 | |
77 | + | let motherId = $t026302779._4 | |
78 | + | let fatherId = $t026302779._5 | |
79 | + | let type = $t026302779._6 | |
80 | + | let imageLink = $t026302779._7 | |
85 | 81 | let description = (((((((((((((("{\"cowCode\": \"" + cowCode) + "\", \"bornedFarmAddress\": \"") + bornedFarmAddress) + "\", \"genes\": \"") + genes) + "\", \"motherId\": \"") + motherId) + "\", \"fatherId\": \"") + fatherId) + "\", \"type\": \"") + type) + "\", \"imageLink\": \"") + imageLink) + "\"") | |
86 | 82 | let issue = Issue(cowNft_name, ((description + imageLink) + "\"}"), 1, 0, false) | |
87 | 83 | let id = calculateAssetId(issue) |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 6 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let admin1 = "BgxpCm4wxbW8SKLPKZnf4KU2D6ZU29ov8MgZrkaSAqpY" | |
5 | 5 | ||
6 | 6 | let admin2 = "" | |
7 | 7 | ||
8 | 8 | let key_farmNft_nextNumber = "farmNft_nextNumber" | |
9 | 9 | ||
10 | 10 | let farmNft_name = "Cattle NFT" | |
11 | 11 | ||
12 | 12 | let cowNft_name = "Cow NFT" | |
13 | 13 | ||
14 | 14 | let farmNft_description = "{\"image\": \"" | |
15 | 15 | ||
16 | 16 | let live = "ACTIVE" | |
17 | 17 | ||
18 | 18 | let dead = "INACTIVE" | |
19 | 19 | ||
20 | 20 | let fatten = "FATTEN" | |
21 | 21 | ||
22 | 22 | func tryGetInteger (key) = match getInteger(this, key) { | |
23 | 23 | case b: Int => | |
24 | 24 | b | |
25 | 25 | case _ => | |
26 | 26 | 0 | |
27 | 27 | } | |
28 | 28 | ||
29 | 29 | ||
30 | 30 | func tryGetString (key) = match getString(this, key) { | |
31 | 31 | case a: String => | |
32 | 32 | a | |
33 | 33 | case _ => | |
34 | 34 | "" | |
35 | 35 | } | |
36 | 36 | ||
37 | 37 | ||
38 | - | func allow (callerPbk) = if (if ((callerPbk == admin1)) | |
39 | - | then true | |
40 | - | else (callerPbk == admin2)) | |
41 | - | then true | |
42 | - | else false | |
38 | + | func allow (callerPbk) = true | |
43 | 39 | ||
44 | 40 | ||
45 | 41 | @Callable(i) | |
46 | 42 | func registerFarm (address,params) = { | |
47 | 43 | let callerPbk = toBase58String(i.callerPublicKey) | |
48 | 44 | if (allow(callerPbk)) | |
49 | 45 | then { | |
50 | 46 | let recipient = addressFromStringValue(address) | |
51 | 47 | let p_arr = split_4C(params, "|") | |
52 | - | let $ | |
53 | - | let farmName = $ | |
54 | - | let farmLocation = $ | |
55 | - | let imageLink = $ | |
48 | + | let $t014911563 = $Tuple3(p_arr[0], p_arr[1], p_arr[2]) | |
49 | + | let farmName = $t014911563._1 | |
50 | + | let farmLocation = $t014911563._2 | |
51 | + | let imageLink = $t014911563._3 | |
56 | 52 | let nextNum = tryGetInteger(key_farmNft_nextNumber) | |
57 | 53 | if ((nextNum == nextNum)) | |
58 | 54 | then { | |
59 | 55 | let issue = Issue((farmNft_name + toString(nextNum)), ((farmNft_description + imageLink) + "\"}"), 1, 0, false) | |
60 | 56 | let id = calculateAssetId(issue) | |
61 | 57 | $Tuple2([issue, ScriptTransfer(recipient, 1, id), IntegerEntry(key_farmNft_nextNumber, (nextNum + 1)), StringEntry((("farm_" + address) + "_name"), farmName), StringEntry((("farm_" + address) + "_location"), farmLocation)], $Tuple4(nextNum, farmName, farmLocation, imageLink)) | |
62 | 58 | } | |
63 | 59 | else throw("Strict value is not equal to itself.") | |
64 | 60 | } | |
65 | 61 | else throw("Not allowed caller") | |
66 | 62 | } | |
67 | 63 | ||
68 | 64 | ||
69 | 65 | ||
70 | 66 | @Callable(i) | |
71 | 67 | func registerCow (address,params) = { | |
72 | 68 | let callerPbk = toBase58String(i.callerPublicKey) | |
73 | 69 | if (allow(callerPbk)) | |
74 | 70 | then { | |
75 | 71 | let recipient = addressFromStringValue(address) | |
76 | 72 | let p_arr = split_4C(params, params) | |
77 | - | let $ | |
78 | - | let cowCode = $ | |
79 | - | let bornedFarmAddress = $ | |
80 | - | let genes = $ | |
81 | - | let motherId = $ | |
82 | - | let fatherId = $ | |
83 | - | let type = $ | |
84 | - | let imageLink = $ | |
73 | + | let $t026302779 = $Tuple7(p_arr[0], p_arr[1], p_arr[2], p_arr[3], p_arr[4], p_arr[5], p_arr[6]) | |
74 | + | let cowCode = $t026302779._1 | |
75 | + | let bornedFarmAddress = $t026302779._2 | |
76 | + | let genes = $t026302779._3 | |
77 | + | let motherId = $t026302779._4 | |
78 | + | let fatherId = $t026302779._5 | |
79 | + | let type = $t026302779._6 | |
80 | + | let imageLink = $t026302779._7 | |
85 | 81 | let description = (((((((((((((("{\"cowCode\": \"" + cowCode) + "\", \"bornedFarmAddress\": \"") + bornedFarmAddress) + "\", \"genes\": \"") + genes) + "\", \"motherId\": \"") + motherId) + "\", \"fatherId\": \"") + fatherId) + "\", \"type\": \"") + type) + "\", \"imageLink\": \"") + imageLink) + "\"") | |
86 | 82 | let issue = Issue(cowNft_name, ((description + imageLink) + "\"}"), 1, 0, false) | |
87 | 83 | let id = calculateAssetId(issue) | |
88 | 84 | [issue, ScriptTransfer(recipient, 1, id), StringEntry((((("farm_" + address) + "_cow_") + toBase58String(id)) + "_status"), live), StringEntry((("cow_" + toBase58String(id)) + "_owner"), address)] | |
89 | 85 | } | |
90 | 86 | else throw("Not allowed caller") | |
91 | 87 | } | |
92 | 88 | ||
93 | 89 | ||
94 | 90 | ||
95 | 91 | @Callable(i) | |
96 | 92 | func init () = { | |
97 | 93 | let callerPbk = toBase58String(i.callerPublicKey) | |
98 | 94 | if (allow(callerPbk)) | |
99 | 95 | then [IntegerEntry(key_farmNft_nextNumber, 1)] | |
100 | 96 | else throw("Not allowed caller") | |
101 | 97 | } | |
102 | 98 | ||
103 | 99 |
github/deemru/w8io/026f985 34.52 ms ◑