tx · CQkYnqzadwS3gXS8PtokDHfb6iYYGgtffTH5fKV81C2R

3MzcHAM4DcpYKt1ZAMibQmqU69pKQ6qz3i4:  -0.00300000 Waves

2023.03.26 00:22 [2506055] smart account 3MzcHAM4DcpYKt1ZAMibQmqU69pKQ6qz3i4 > SELF 0.00000000 Waves

{ "type": 13, "id": "CQkYnqzadwS3gXS8PtokDHfb6iYYGgtffTH5fKV81C2R", "fee": 300000, "feeAssetId": null, "timestamp": 1679779347971, "version": 2, "chainId": 84, "sender": "3MzcHAM4DcpYKt1ZAMibQmqU69pKQ6qz3i4", "senderPublicKey": "DoAid1WtwHRuonKq6xKkbxijk1QQhXG75vdyuUM7n7NN", "proofs": [ "46oX2ygbgqgJV7C7kRdqmEapg4ofabtPuvtnDWibu8gdAxD7C7k3RDEXzH3Dna3vgaeVnuJpKxtJ7ov9i1qtVkbv" ], "script": "base64:BgIOCAISBAoCCAgSABIAEgASAAZhZG1pbjECLEYxeWpEZGhvV2N0R1A5eW1HckJrVGROSG1FZlBxdk10aUNGWG1ON2lYTmdyAAZhZG1pbjICAAAKcHV6emxlTWludAIjM1BGUWpqRE1pWktRWmR1NUpxVEhEN0h3Z1NYeXA5Unc5QnkAFmtleV9mYXJtTmZ0X25leHROdW1iZXICEmZhcm1OZnRfbmV4dE51bWJlcgAQa2V5X2Zhcm1OZnRfbmFtZQIMZmFybU5mdF9uYW1lABdrZXlfZmFybU5mdF9kZXNjcmlwdGlvbgITZmFybU5mdF9kZXNjcmlwdGlvbgAWa2V5X2Zhcm1OZnRfY29sbGVjdGlvbgISZmFybU5mdF9jb2xsZWN0aW9uABFrZXlfZmFybU5mdF9pbWFnZQINZmFybU5mdF9pbWFnZQAPa2V5X2Nvd05mdF9uYW1lAgtjb3dOZnRfbmFtZQAWa2V5X2Nvd05mdF9kZXNjcmlwdGlvbgISY293TmZ0X2Rlc2NyaXB0aW9uABVrZXlfY293TmZ0X2NvbGxlY3Rpb24CEWNvd05mdF9jb2xsZWN0aW9uABB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LgkAAgECEk5vdCBhbGxvd2VkIGNhbGxlcgFpAQR0ZXN0AAQBcgoAAUAJAPwHBAUEdGhpcwIEbWludAUDbmlsBQNuaWwDCQABAgUBQAIGU3RyaW5nBQFACQACAQkArAICCQADAQUBQAIbIGNvdWxkbid0IGJlIGNhc3QgdG8gU3RyaW5nAwkAAAIFAXIFAXIDBgkAAgEFAXIFA25pbAkAAgECJFN0cmljdCB2YWx1ZSBpcyBub3QgZXF1YWwgdG8gaXRzZWxmLgFpAQRtaW50AAkAlAoCBQNuaWwAKgFpAQRpbml0AAQJY2FsbGVyUGJrCQDYBAEIBQFpD2NhbGxlclB1YmxpY0tleQMJAQVhbGxvdwEFCWNhbGxlclBiawQHbmV4dE51bQkBDXRyeUdldEludGVnZXIBBRZrZXlfZmFybU5mdF9uZXh0TnVtYmVyAwkBAiE9AgUHbmV4dE51bQAACQACAQIfQ29udHJhY3QgaXMgYWxyZWFkeSBpbml0aWFsaXplZAkAzAgCCQEMSW50ZWdlckVudHJ5AgUWa2V5X2Zhcm1OZnRfbmV4dE51bWJlcgABBQNuaWwJAAIBAhJOb3QgYWxsb3dlZCBjYWxsZXIAP3t+hQ==", "height": 2506055, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: CKFKmjvtTnEe31yRSn5H1SzxAjxBzit113sNyGDSD2VB Next: 6VwaZBNge2Ak9cAyudwShLrkKDHLhDhWW9kkpma6qomA Diff:
OldNewDifferences
55
66 let admin2 = ""
77
8+let puzzleMint = "3PFQjjDMiZKQZdu5JqTHD7HwgSXyp9Rw9By"
9+
810 let key_farmNft_nextNumber = "farmNft_nextNumber"
911
10-let farmNft_name = "Cattle NFT "
12+let key_farmNft_name = "farmNft_name"
1113
12-let cowNft_name = "Cow NFT"
14+let key_farmNft_description = "farmNft_description"
1315
14-let farmNft_description = "{\"description\": \"NFT for assotiated cattle\", \"image\": \""
16+let key_farmNft_collection = "farmNft_collection"
17+
18+let key_farmNft_image = "farmNft_image"
19+
20+let key_cowNft_name = "cowNft_name"
21+
22+let key_cowNft_description = "cowNft_description"
23+
24+let key_cowNft_collection = "cowNft_collection"
25+
26+let key_cowNft_image = "cowNft_image"
1527
1628 let live = "ACTIVE"
1729
4961 then {
5062 let recipient = addressFromStringValue(address)
5163 let p_arr = split_4C(params, "|")
52- let $t014961568 = $Tuple3(p_arr[0], p_arr[1], p_arr[2])
53- let farmName = $t014961568._1
54- let farmLocation = $t014961568._2
55- let imageLink = $t014961568._3
64+ let $t017441795 = $Tuple2(p_arr[0], p_arr[1])
65+ let farmName = $t017441795._1
66+ let farmLocation = $t017441795._2
5667 let nextNum = tryGetInteger(key_farmNft_nextNumber)
5768 if ((nextNum == nextNum))
5869 then {
59- let issue = Issue((farmNft_name + toString(nextNum)), ((farmNft_description + imageLink) + "\"}"), 1, 0, false)
60- let id = calculateAssetId(issue)
61- $Tuple2([issue, ScriptTransfer(recipient, 1, id), IntegerEntry(key_farmNft_nextNumber, (nextNum + 1)), BooleanEntry((("farm_" + address) + "_status"), true), StringEntry((("farm_" + address) + "_name"), farmName), StringEntry((("farm_" + address) + "_location"), farmLocation)], $Tuple4(nextNum, farmName, farmLocation, imageLink))
70+ let farmNftName = (tryGetString(key_farmNft_name) + toString(nextNum))
71+ let farmNftDescription = tryGetString(key_farmNft_description)
72+ let farmNftCollection = tryGetString(key_farmNft_collection)
73+ let farmNftImage = tryGetString(key_farmNft_image)
74+ let assetId = {
75+ let @ = invoke(addressFromStringValue(puzzleMint), "mint", [farmNftName, farmNftDescription, farmNftCollection, farmNftImage, farmNftImage, 1, "", "", ""], nil)
76+ if ($isInstanceOf(@, "String"))
77+ then @
78+ else throw(($getType(@) + " couldn't be cast to String"))
79+ }
80+ if ((assetId == assetId))
81+ then $Tuple2([ScriptTransfer(recipient, 1, fromBase58String(assetId)), IntegerEntry(key_farmNft_nextNumber, (nextNum + 1)), BooleanEntry((("farm_" + address) + "_status"), true), StringEntry((("farm_" + address) + "_name"), farmName), StringEntry((("farm_" + address) + "_location"), farmLocation)], $Tuple3(nextNum, farmName, farmLocation))
82+ else throw("Strict value is not equal to itself.")
6283 }
6384 else throw("Strict value is not equal to itself.")
6485 }
6889
6990
7091 @Callable(i)
71-func registerCow (address,params) = {
72- let callerPbk = toBase58String(i.callerPublicKey)
73- if (allow(callerPbk))
74- then {
75- let recipient = addressFromStringValue(address)
76- let p_arr = split_4C(params, params)
77- let $t026742823 = $Tuple7(p_arr[0], p_arr[1], p_arr[2], p_arr[3], p_arr[4], p_arr[5], p_arr[6])
78- let cowCode = $t026742823._1
79- let bornedFarmAddress = $t026742823._2
80- let genes = $t026742823._3
81- let motherId = $t026742823._4
82- let fatherId = $t026742823._5
83- let type = $t026742823._6
84- let imageLink = $t026742823._7
85- let description = (((((((((((((("{\"cowCode\": \"" + cowCode) + "\", \"bornedFarmAddress\": \"") + bornedFarmAddress) + "\", \"genes\": \"") + genes) + "\", \"motherId\": \"") + motherId) + "\", \"fatherId\": \"") + fatherId) + "\", \"type\": \"") + type) + "\", \"imageLink\": \"") + imageLink) + "\"")
86- let issue = Issue(cowNft_name, ((description + imageLink) + "\"}"), 1, 0, false)
87- let id = calculateAssetId(issue)
88-[issue, ScriptTransfer(recipient, 1, id), StringEntry((((("farm_" + address) + "_cow_") + toBase58String(id)) + "_status"), live), StringEntry((("cow_" + toBase58String(id)) + "_owner"), address)]
89- }
90- else throw("Not allowed caller")
92+func test () = {
93+ let r = {
94+ let @ = invoke(this, "mint", nil, nil)
95+ if ($isInstanceOf(@, "String"))
96+ then @
97+ else throw(($getType(@) + " couldn't be cast to String"))
98+ }
99+ if ((r == r))
100+ then if (true)
101+ then throw(r)
102+ else nil
103+ else throw("Strict value is not equal to itself.")
91104 }
105+
106+
107+
108+@Callable(i)
109+func mint () = $Tuple2(nil, 42)
92110
93111
94112
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 6 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let admin1 = "F1yjDdhoWctGP9ymGrBkTdNHmEfPqvMtiCFXmN7iXNgr"
55
66 let admin2 = ""
77
8+let puzzleMint = "3PFQjjDMiZKQZdu5JqTHD7HwgSXyp9Rw9By"
9+
810 let key_farmNft_nextNumber = "farmNft_nextNumber"
911
10-let farmNft_name = "Cattle NFT "
12+let key_farmNft_name = "farmNft_name"
1113
12-let cowNft_name = "Cow NFT"
14+let key_farmNft_description = "farmNft_description"
1315
14-let farmNft_description = "{\"description\": \"NFT for assotiated cattle\", \"image\": \""
16+let key_farmNft_collection = "farmNft_collection"
17+
18+let key_farmNft_image = "farmNft_image"
19+
20+let key_cowNft_name = "cowNft_name"
21+
22+let key_cowNft_description = "cowNft_description"
23+
24+let key_cowNft_collection = "cowNft_collection"
25+
26+let key_cowNft_image = "cowNft_image"
1527
1628 let live = "ACTIVE"
1729
1830 let dead = "INACTIVE"
1931
2032 let fatten = "FATTEN"
2133
2234 func tryGetInteger (key) = match getInteger(this, key) {
2335 case b: Int =>
2436 b
2537 case _ =>
2638 0
2739 }
2840
2941
3042 func tryGetString (key) = match getString(this, key) {
3143 case a: String =>
3244 a
3345 case _ =>
3446 ""
3547 }
3648
3749
3850 func allow (callerPbk) = if (if ((callerPbk == admin1))
3951 then true
4052 else (callerPbk == admin2))
4153 then true
4254 else false
4355
4456
4557 @Callable(i)
4658 func registerFarm (address,params) = {
4759 let callerPbk = toBase58String(i.callerPublicKey)
4860 if (allow(callerPbk))
4961 then {
5062 let recipient = addressFromStringValue(address)
5163 let p_arr = split_4C(params, "|")
52- let $t014961568 = $Tuple3(p_arr[0], p_arr[1], p_arr[2])
53- let farmName = $t014961568._1
54- let farmLocation = $t014961568._2
55- let imageLink = $t014961568._3
64+ let $t017441795 = $Tuple2(p_arr[0], p_arr[1])
65+ let farmName = $t017441795._1
66+ let farmLocation = $t017441795._2
5667 let nextNum = tryGetInteger(key_farmNft_nextNumber)
5768 if ((nextNum == nextNum))
5869 then {
59- let issue = Issue((farmNft_name + toString(nextNum)), ((farmNft_description + imageLink) + "\"}"), 1, 0, false)
60- let id = calculateAssetId(issue)
61- $Tuple2([issue, ScriptTransfer(recipient, 1, id), IntegerEntry(key_farmNft_nextNumber, (nextNum + 1)), BooleanEntry((("farm_" + address) + "_status"), true), StringEntry((("farm_" + address) + "_name"), farmName), StringEntry((("farm_" + address) + "_location"), farmLocation)], $Tuple4(nextNum, farmName, farmLocation, imageLink))
70+ let farmNftName = (tryGetString(key_farmNft_name) + toString(nextNum))
71+ let farmNftDescription = tryGetString(key_farmNft_description)
72+ let farmNftCollection = tryGetString(key_farmNft_collection)
73+ let farmNftImage = tryGetString(key_farmNft_image)
74+ let assetId = {
75+ let @ = invoke(addressFromStringValue(puzzleMint), "mint", [farmNftName, farmNftDescription, farmNftCollection, farmNftImage, farmNftImage, 1, "", "", ""], nil)
76+ if ($isInstanceOf(@, "String"))
77+ then @
78+ else throw(($getType(@) + " couldn't be cast to String"))
79+ }
80+ if ((assetId == assetId))
81+ then $Tuple2([ScriptTransfer(recipient, 1, fromBase58String(assetId)), IntegerEntry(key_farmNft_nextNumber, (nextNum + 1)), BooleanEntry((("farm_" + address) + "_status"), true), StringEntry((("farm_" + address) + "_name"), farmName), StringEntry((("farm_" + address) + "_location"), farmLocation)], $Tuple3(nextNum, farmName, farmLocation))
82+ else throw("Strict value is not equal to itself.")
6283 }
6384 else throw("Strict value is not equal to itself.")
6485 }
6586 else throw("Not allowed caller")
6687 }
6788
6889
6990
7091 @Callable(i)
71-func registerCow (address,params) = {
72- let callerPbk = toBase58String(i.callerPublicKey)
73- if (allow(callerPbk))
74- then {
75- let recipient = addressFromStringValue(address)
76- let p_arr = split_4C(params, params)
77- let $t026742823 = $Tuple7(p_arr[0], p_arr[1], p_arr[2], p_arr[3], p_arr[4], p_arr[5], p_arr[6])
78- let cowCode = $t026742823._1
79- let bornedFarmAddress = $t026742823._2
80- let genes = $t026742823._3
81- let motherId = $t026742823._4
82- let fatherId = $t026742823._5
83- let type = $t026742823._6
84- let imageLink = $t026742823._7
85- let description = (((((((((((((("{\"cowCode\": \"" + cowCode) + "\", \"bornedFarmAddress\": \"") + bornedFarmAddress) + "\", \"genes\": \"") + genes) + "\", \"motherId\": \"") + motherId) + "\", \"fatherId\": \"") + fatherId) + "\", \"type\": \"") + type) + "\", \"imageLink\": \"") + imageLink) + "\"")
86- let issue = Issue(cowNft_name, ((description + imageLink) + "\"}"), 1, 0, false)
87- let id = calculateAssetId(issue)
88-[issue, ScriptTransfer(recipient, 1, id), StringEntry((((("farm_" + address) + "_cow_") + toBase58String(id)) + "_status"), live), StringEntry((("cow_" + toBase58String(id)) + "_owner"), address)]
89- }
90- else throw("Not allowed caller")
92+func test () = {
93+ let r = {
94+ let @ = invoke(this, "mint", nil, nil)
95+ if ($isInstanceOf(@, "String"))
96+ then @
97+ else throw(($getType(@) + " couldn't be cast to String"))
98+ }
99+ if ((r == r))
100+ then if (true)
101+ then throw(r)
102+ else nil
103+ else throw("Strict value is not equal to itself.")
91104 }
105+
106+
107+
108+@Callable(i)
109+func mint () = $Tuple2(nil, 42)
92110
93111
94112
95113 @Callable(i)
96114 func init () = {
97115 let callerPbk = toBase58String(i.callerPublicKey)
98116 if (allow(callerPbk))
99117 then {
100118 let nextNum = tryGetInteger(key_farmNft_nextNumber)
101119 if ((nextNum != 0))
102120 then throw("Contract is already initialized")
103121 else [IntegerEntry(key_farmNft_nextNumber, 1)]
104122 }
105123 else throw("Not allowed caller")
106124 }
107125
108126

github/deemru/w8io/026f985 
25.89 ms