tx · EBat6D5etJp3WYMzddKmtw3GxwvG6EvFehM65S7uf3LP

3MzcHAM4DcpYKt1ZAMibQmqU69pKQ6qz3i4:  -0.00300000 Waves

2023.03.24 02:01 [2503284] smart account 3MzcHAM4DcpYKt1ZAMibQmqU69pKQ6qz3i4 > SELF 0.00000000 Waves

{ "type": 13, "id": "EBat6D5etJp3WYMzddKmtw3GxwvG6EvFehM65S7uf3LP", "fee": 300000, "feeAssetId": null, "timestamp": 1679612515201, "version": 2, "chainId": 84, "sender": "3MzcHAM4DcpYKt1ZAMibQmqU69pKQ6qz3i4", "senderPublicKey": "DoAid1WtwHRuonKq6xKkbxijk1QQhXG75vdyuUM7n7NN", "proofs": [ "5hGiqjDtrVbkw9n5AQSgNUF7Yfkii5ZTZfpJs8mmJFh2F711VgS6jCptDRWa7Uq1CazJL8XVAsgfLPkKAo6JWUsj" ], "script": "base64:BgIQCAISBAoCCAgSBAoCCAgSAAwABmFkbWluMQIsQmd4cENtNHd4Ylc4U0tMUEtabmY0S1UyRDZaVTI5b3Y4TWdacmthU0FxcFkABmFkbWluMgIAABZrZXlfZmFybU5mdF9uZXh0TnVtYmVyAhJmYXJtTmZ0X25leHROdW1iZXIADGZhcm1OZnRfbmFtZQIKQ2F0dGxlIE5GVAALY293TmZ0X25hbWUCB0NvdyBORlQAE2Zhcm1OZnRfZGVzY3JpcHRpb24CC3siaW1hZ2UiOiAiAARsaXZlAgZBQ1RJVkUABGRlYWQCCElOQUNUSVZFAAZmYXR0ZW4CBkZBVFRFTgENdHJ5R2V0SW50ZWdlcgEDa2V5BAckbWF0Y2gwCQCaCAIFBHRoaXMFA2tleQMJAAECBQckbWF0Y2gwAgNJbnQEAWIFByRtYXRjaDAFAWIAAAEMdHJ5R2V0U3RyaW5nAQNrZXkEByRtYXRjaDAJAJ0IAgUEdGhpcwUDa2V5AwkAAQIFByRtYXRjaDACBlN0cmluZwQBYQUHJG1hdGNoMAUBYQIAAQVhbGxvdwEJY2FsbGVyUGJrAwMJAA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ESIsICJpbWFnZUxpbmsiOiAiBQlpbWFnZUxpbmsCASIEBWlzc3VlCQDCCAUFC2Nvd05mdF9uYW1lCQCsAgIJAKwCAgULZGVzY3JpcHRpb24FCWltYWdlTGluawICIn0AAQAABwQCaWQJALgIAQUFaXNzdWUJAMwIAgUFaXNzdWUJAMwIAgkBDlNjcmlwdFRyYW5zZmVyAwUJcmVjaXBpZW50AAEFAmlkCQDMCAIJAQtTdHJpbmdFbnRyeQIJAKwCAgkArAICCQCsAgIJAKwCAgIFZmFybV8FB2FkZHJlc3MCBV9jb3dfCQDYBAEFAmlkAgdfc3RhdHVzBQRsaXZlCQDMCAIJAQtTdHJpbmdFbnRyeQIJAKwCAgkArAICAgRjb3dfCQDYBAEFAmlkAgZfb3duZXIFB2FkZHJlc3MFA25pbAkAAgECEk5vdCBhbGxvd2VkIGNhbGxlcgFpAQRpbml0AAQJY2FsbGVyUGJrCQDYBAEIBQFpD2NhbGxlclB1YmxpY0tleQMJAQVhbGxvdwEFCWNhbGxlclBiawkAzAgCCQEMSW50ZWdlckVudHJ5AgUWa2V5X2Zhcm1OZnRfbmV4dE51bWJlcgABBQNuaWwJAAIBAhJOb3QgYWxsb3dlZCBjYWxsZXIAcC9zrg==", "height": 2503284, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: DarajS5ETdhk69YZXx7YS95dmmZBXdu6Jb23334xPtmW Next: BDcyKXf3MJzSqnzkYmWdgaH6c7qmyMdp9U2hruiE2hMd Diff:
OldNewDifferences
9393
9494
9595 @Callable(i)
96-func init () = [IntegerEntry(key_farmNft_nextNumber, 1)]
96+func init () = {
97+ let callerPbk = toBase58String(i.callerPublicKey)
98+ if (allow(callerPbk))
99+ then [IntegerEntry(key_farmNft_nextNumber, 1)]
100+ else throw("Not allowed caller")
101+ }
97102
98103
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 6 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let admin1 = "BgxpCm4wxbW8SKLPKZnf4KU2D6ZU29ov8MgZrkaSAqpY"
55
66 let admin2 = ""
77
88 let key_farmNft_nextNumber = "farmNft_nextNumber"
99
1010 let farmNft_name = "Cattle NFT"
1111
1212 let cowNft_name = "Cow NFT"
1313
1414 let farmNft_description = "{\"image\": \""
1515
1616 let live = "ACTIVE"
1717
1818 let dead = "INACTIVE"
1919
2020 let fatten = "FATTEN"
2121
2222 func tryGetInteger (key) = match getInteger(this, key) {
2323 case b: Int =>
2424 b
2525 case _ =>
2626 0
2727 }
2828
2929
3030 func tryGetString (key) = match getString(this, key) {
3131 case a: String =>
3232 a
3333 case _ =>
3434 ""
3535 }
3636
3737
3838 func allow (callerPbk) = if (if ((callerPbk == admin1))
3939 then true
4040 else (callerPbk == admin2))
4141 then true
4242 else false
4343
4444
4545 @Callable(i)
4646 func registerFarm (address,params) = {
4747 let callerPbk = toBase58String(i.callerPublicKey)
4848 if (allow(callerPbk))
4949 then {
5050 let recipient = addressFromStringValue(address)
5151 let p_arr = split_4C(params, "|")
5252 let $t014791551 = $Tuple3(p_arr[0], p_arr[1], p_arr[2])
5353 let farmName = $t014791551._1
5454 let farmLocation = $t014791551._2
5555 let imageLink = $t014791551._3
5656 let nextNum = tryGetInteger(key_farmNft_nextNumber)
5757 if ((nextNum == nextNum))
5858 then {
5959 let issue = Issue((farmNft_name + toString(nextNum)), ((farmNft_description + imageLink) + "\"}"), 1, 0, false)
6060 let id = calculateAssetId(issue)
6161 $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))
6262 }
6363 else throw("Strict value is not equal to itself.")
6464 }
6565 else throw("Not allowed caller")
6666 }
6767
6868
6969
7070 @Callable(i)
7171 func registerCow (address,params) = {
7272 let callerPbk = toBase58String(i.callerPublicKey)
7373 if (allow(callerPbk))
7474 then {
7575 let recipient = addressFromStringValue(address)
7676 let p_arr = split_4C(params, params)
7777 let $t026182767 = $Tuple7(p_arr[0], p_arr[1], p_arr[2], p_arr[3], p_arr[4], p_arr[5], p_arr[6])
7878 let cowCode = $t026182767._1
7979 let bornedFarmAddress = $t026182767._2
8080 let genes = $t026182767._3
8181 let motherId = $t026182767._4
8282 let fatherId = $t026182767._5
8383 let type = $t026182767._6
8484 let imageLink = $t026182767._7
8585 let description = (((((((((((((("{\"cowCode\": \"" + cowCode) + "\", \"bornedFarmAddress\": \"") + bornedFarmAddress) + "\", \"genes\": \"") + genes) + "\", \"motherId\": \"") + motherId) + "\", \"fatherId\": \"") + fatherId) + "\", \"type\": \"") + type) + "\", \"imageLink\": \"") + imageLink) + "\"")
8686 let issue = Issue(cowNft_name, ((description + imageLink) + "\"}"), 1, 0, false)
8787 let id = calculateAssetId(issue)
8888 [issue, ScriptTransfer(recipient, 1, id), StringEntry((((("farm_" + address) + "_cow_") + toBase58String(id)) + "_status"), live), StringEntry((("cow_" + toBase58String(id)) + "_owner"), address)]
8989 }
9090 else throw("Not allowed caller")
9191 }
9292
9393
9494
9595 @Callable(i)
96-func init () = [IntegerEntry(key_farmNft_nextNumber, 1)]
96+func init () = {
97+ let callerPbk = toBase58String(i.callerPublicKey)
98+ if (allow(callerPbk))
99+ then [IntegerEntry(key_farmNft_nextNumber, 1)]
100+ else throw("Not allowed caller")
101+ }
97102
98103

github/deemru/w8io/026f985 
34.70 ms