tx · JoYmWzbFSF4u7pxzhmoQuqLMcsu5Q1vyi126YpumFjv 3MzcHAM4DcpYKt1ZAMibQmqU69pKQ6qz3i4: -0.00300000 Waves 2023.03.24 01:34 [2503253] smart account 3MzcHAM4DcpYKt1ZAMibQmqU69pKQ6qz3i4 > SELF 0.00000000 Waves
{ "type": 13, "id": "JoYmWzbFSF4u7pxzhmoQuqLMcsu5Q1vyi126YpumFjv", "fee": 300000, "feeAssetId": null, "timestamp": 1679610901695, "version": 2, "chainId": 84, "sender": "3MzcHAM4DcpYKt1ZAMibQmqU69pKQ6qz3i4", "senderPublicKey": "DoAid1WtwHRuonKq6xKkbxijk1QQhXG75vdyuUM7n7NN", "proofs": [ "43WhbUZ7rQQ397v6VmgQPjakJ3TPr4cCDhxAa1UmBMJgbDMeNabhFXvuMiFjVtvtWTtGK4rxFJ9UxACXYYywqbYL" ], "script": "base64:BgIQCAISBAoCCAgSBAoCCAgSAAwABmFkbWluMQIsQmd4cENtNHd4Ylc4U0tMUEtabmY0S1UyRDZaVTI5b3Y4TWdacmthU0FxcFkABmFkbWluMgIAABZrZXlfZmFybU5mdF9uZXh0TnVtYmVyAhJmYXJtTmZ0X25leHROdW1iZXIADGZhcm1OZnRfbmFtZQITQXNzb3RpYXRlZCBGYXJtIE5GVAALY293TmZ0X25hbWUCEkFzc290aWF0ZWQgQ293IE5GVAATZmFybU5mdF9kZXNjcmlwdGlvbgILeyJpbWFnZSI6ICIABGxpdmUCBkFDVElWRQAEZGVhZAIISU5BQ1RJVkUABmZhdHRlbgIGRkFUVEVOAQ10cnlHZXRJbnRlZ2VyAQNrZXkEByRtYXRjaDAJAJoIAgUEdGhpcwUDa2V5AwkAAQIFByRtYXRjaDACA0ludAQBYgUHJG1hdGNoMAUBYgAAAQx0cnlHZXRTdHJpbmcBA2tleQQHJG1hdGNoMAkAnQgCBQR0aGlzBQNrZXkDCQABAgUHJG1hdGNoMAIGU3RyaW5nBAFhBQckbWF0Y2gwBQFhAgABBWFsbG93AQ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IgQFaXNzdWUJAMIIBQULY293TmZ0X25hbWUJAKwCAgkArAICBQtkZXNjcmlwdGlvbgUJaW1hZ2VMaW5rAgIifQABAAAHBAJpZAkAuAgBBQVpc3N1ZQkAzAgCBQVpc3N1ZQkAzAgCCQEOU2NyaXB0VHJhbnNmZXIDBQlyZWNpcGllbnQAAQUCaWQJAMwIAgkBC1N0cmluZ0VudHJ5AgkArAICCQCsAgIJAKwCAgkArAICAgVmYXJtXwUHYWRkcmVzcwIFX2Nvd18JANgEAQUCaWQCB19zdGF0dXMFBGxpdmUJAMwIAgkBC1N0cmluZ0VudHJ5AgkArAICCQCsAgICBGNvd18JANgEAQUCaWQCBl9vd25lcgUHYWRkcmVzcwUDbmlsCQACAQISTm90IGFsbG93ZWQgY2FsbGVyAWkBBGluaXQACQDMCAIJAQxJbnRlZ2VyRW50cnkCBRZrZXlfZmFybU5mdF9uZXh0TnVtYmVyAAEFA25pbAAT1otL", "height": 2503253, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 8DGoGJDjgqvtwMUNPmPy7eR26z7yCfMqYgSHrm7NcL64 Next: 135K9ZiYhhk59Rkwg7wX9jTGoNVriargs7eHcxUtkw7y Full:
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 6 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | - | let pbk = base58'AwWYbCDs6GDxAT6diG2mfEqD7tFz9JXu9k234FS135kR' | |
4 | + | let admin1 = "BgxpCm4wxbW8SKLPKZnf4KU2D6ZU29ov8MgZrkaSAqpY" | |
5 | + | ||
6 | + | let admin2 = "" | |
7 | + | ||
8 | + | let key_farmNft_nextNumber = "farmNft_nextNumber" | |
9 | + | ||
10 | + | let farmNft_name = "Assotiated Farm NFT" | |
11 | + | ||
12 | + | let cowNft_name = "Assotiated Cow NFT" | |
13 | + | ||
14 | + | let farmNft_description = "{\"image\": \"" | |
15 | + | ||
16 | + | let live = "ACTIVE" | |
17 | + | ||
18 | + | let dead = "INACTIVE" | |
19 | + | ||
20 | + | let fatten = "FATTEN" | |
21 | + | ||
22 | + | func tryGetInteger (key) = match getInteger(this, key) { | |
23 | + | case b: Int => | |
24 | + | b | |
25 | + | case _ => | |
26 | + | 0 | |
27 | + | } | |
28 | + | ||
29 | + | ||
30 | + | func tryGetString (key) = match getString(this, key) { | |
31 | + | case a: String => | |
32 | + | a | |
33 | + | case _ => | |
34 | + | "" | |
35 | + | } | |
36 | + | ||
37 | + | ||
38 | + | func allow (callerPbk) = if (if ((callerPbk == admin1)) | |
39 | + | then true | |
40 | + | else (callerPbk == admin2)) | |
41 | + | then true | |
42 | + | else false | |
43 | + | ||
5 | 44 | ||
6 | 45 | @Callable(i) | |
7 | - | func abc () = { | |
8 | - | let tax = invoke(addressFromPublicKey(pbk), "pay_tax", nil, [AttachedPayment(fromBase58String("AFQS5E4ELtxex3iANtWtUU2V2oWJZSo8VVnK8z3VFmqf"), 444)]) | |
9 | - | if ((tax == tax)) | |
10 | - | then nil | |
11 | - | else throw("Strict value is not equal to itself.") | |
46 | + | func registerFarm (address,params) = { | |
47 | + | let callerPbk = toBase58String(i.callerPublicKey) | |
48 | + | if (allow(callerPbk)) | |
49 | + | then { | |
50 | + | let recipient = addressFromStringValue(address) | |
51 | + | let p_arr = split_4C(params, "|") | |
52 | + | let $t014581530 = $Tuple3(p_arr[0], p_arr[1], p_arr[2]) | |
53 | + | let farmName = $t014581530._1 | |
54 | + | let farmLocation = $t014581530._2 | |
55 | + | let imageLink = $t014581530._3 | |
56 | + | let nextNum = tryGetInteger(key_farmNft_nextNumber) | |
57 | + | if ((nextNum == nextNum)) | |
58 | + | then { | |
59 | + | let issue = Issue((farmNft_name + toString(nextNum)), ((farmNft_description + imageLink) + "\"}"), 1, 0, false) | |
60 | + | let id = calculateAssetId(issue) | |
61 | + | [issue, ScriptTransfer(recipient, 1, id), IntegerEntry(key_farmNft_nextNumber, (nextNum + 1)), StringEntry((("farm_" + address) + "_name"), farmName), StringEntry((("farm_" + address) + "_location"), farmLocation)] | |
62 | + | } | |
63 | + | else throw("Strict value is not equal to itself.") | |
64 | + | } | |
65 | + | else throw("Not allowed caller") | |
12 | 66 | } | |
67 | + | ||
68 | + | ||
69 | + | ||
70 | + | @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 $t025492698 = $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 = $t025492698._1 | |
79 | + | let bornedFarmAddress = $t025492698._2 | |
80 | + | let genes = $t025492698._3 | |
81 | + | let motherId = $t025492698._4 | |
82 | + | let fatherId = $t025492698._5 | |
83 | + | let type = $t025492698._6 | |
84 | + | let imageLink = $t025492698._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") | |
91 | + | } | |
92 | + | ||
93 | + | ||
94 | + | ||
95 | + | @Callable(i) | |
96 | + | func init () = [IntegerEntry(key_farmNft_nextNumber, 1)] | |
13 | 97 | ||
14 | 98 |
github/deemru/w8io/026f985 23.78 ms ◑