tx · 3rBgt52TtNpnVNvkg6raKJMmVV4rKh3abXhygAoWJsEQ

3PJuMJL5yu4QKwzCU1K9ahprWqtMzAup1r9:  -0.01400000 Waves

2023.06.04 07:41 [3672989] smart account 3PJuMJL5yu4QKwzCU1K9ahprWqtMzAup1r9 > SELF 0.00000000 Waves

{ "type": 13, "id": "3rBgt52TtNpnVNvkg6raKJMmVV4rKh3abXhygAoWJsEQ", "fee": 1400000, "feeAssetId": null, "timestamp": 1685853736509, "version": 2, "chainId": 87, "sender": "3PJuMJL5yu4QKwzCU1K9ahprWqtMzAup1r9", "senderPublicKey": "7XtbosGrF6WkTPG6q87zwwsmxptTBnc8inEcWTuhtn8v", "proofs": [ "c8R1ndG1nDmpYyxaCcqzSsU65qRNn63TeH2KR8UHTYSXsPYcJTjmqjfDGSnSWsoy4mo1YZwMZi3gxwTuJydv3zG" ], "script": "base64:AAIFAAAAAAAAABsIAhIECgIICBIJCgcICAgICAQIEgQKAggIEgAAAAAOAQAAAA10cnlHZXRJbnRlZ2VyAAAAAQAAAANrZXkEAAAAByRtYXRjaDAJAAQaAAAAAgUAAAAEdGhpcwUAAAADa2V5AwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAAANJbnQEAAAAAWIFAAAAByRtYXRjaDAFAAAAAWIAAAAAAAAAAAABAAAADHRyeUdldFN0cmluZwAAAAEAAAADa2V5BAAAAAckbWF0Y2gwCQAEHQAAAAIFAAAABHRoaXMFAAAAA2tleQMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAAGU3RyaW5nBAAAAAFiBQAAAAckbWF0Y2gwBQAAAAFiAgAAAAABAAAACGNoZWNrTkZUAAAAAQAAAAVhc3NldAMDAwkAAAAAAAACCAgFAAAABWFzc2V0AAAABmlzc3VlcgAAAAVieXRlcwgFAAAABHRoaXMAAAAFYnl0ZXMJAAAAAAAAAggFAAAABWFzc2V0AAAACGRlY2ltYWxzAAAAAAAAAAAABwkAAAAAAAACCAUAAAAFYXNzZXQAAAAKcmVpc3N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ZGF0ZWQDCQEAAAACIT0AAAACCQACWAAAAAEIBQAAAAFpAAAAD2NhbGxlclB1YmxpY0tleQUAAAAPY29sbGVjdGlvbk93bmVyCQAAAgAAAAECAAAANHRoaXMgTkZUIGNhbiBiZSB1cGRhdGVkIG9ubHkgYnkgdGhlIGNvbGxlY3Rpb24gb3duZXIJAARMAAAAAgkBAAAAC1N0cmluZ0VudHJ5AAAAAgkBAAAACmtleU5mdE1ldGEAAAABBQAAAAphc3NldElkU3RyBQAAAARtZXRhBQAAAANuaWwAAAABaQEAAAASdGVzdFdpdGhBdHRhY2htZW50AAAAAAkABEwAAAACCQEAAAAMSW50ZWdlckVudHJ5AAAAAgkAASwAAAACCQACWAAAAAEIBQAAAAFpAAAADXRyYW5zYWN0aW9uSWQCAAAABV9wYWlkCAkAAZEAAAACCAUAAAABaQAAAAhwYXltZW50cwAAAAAAAAAAAAAAAAZhbW91bnQFAAAAA25pbAAAAAEAAAACdHgBAAAABnZlcmlmeQAAAAAJAAH0AAAAAwgFAAAAAnR4AAAACWJvZHlCeXRlcwkAAZEAAAACCAUAAAACdHgAAAAGcHJvb2ZzAAAAAAAAAAAACAUAAAACdHgAAAAPc2VuZGVyUHVibGljS2V5uRN1oQ==", "height": 3672989, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: HTWUCkK3CrsTPc8w2kBsfCAm5DjzCYD6gCPRBZRf3GzW Next: none Diff:
OldNewDifferences
113113 }
114114
115115
116+
117+@Callable(i)
118+func testWithAttachment () = [IntegerEntry((toBase58String(i.transactionId) + "_paid"), i.payments[0].amount)]
119+
120+
116121 @Verifier(tx)
117122 func verify () = sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey)
118123
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 5 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 func tryGetInteger (key) = match getInteger(this, key) {
55 case b: Int =>
66 b
77 case _ =>
88 0
99 }
1010
1111
1212 func tryGetString (key) = match getString(this, key) {
1313 case b: String =>
1414 b
1515 case _ =>
1616 ""
1717 }
1818
1919
2020 func checkNFT (asset) = if (if (if ((asset.issuer.bytes == this.bytes))
2121 then (asset.decimals == 0)
2222 else false)
2323 then (asset.reissuable == false)
2424 else false)
2525 then (asset.quantity == 1)
2626 else false
2727
2828
2929 func keyCollectionName (collectionId) = (("collection_" + collectionId) + "_name")
3030
3131
3232 func keyURITemplate (collectionId) = (("collection_" + collectionId) + "_URI")
3333
3434
3535 func keyCollectionSize (collectionId) = (("collection_" + collectionId) + "_size")
3636
3737
3838 func keyCollectionOwner (collectionId) = (("collection_" + collectionId) + "_owner")
3939
4040
4141 func keyCollectionAssetId (collectionId,assetIdStr) = ((("collection_" + collectionId) + "_assetId_") + assetIdStr)
4242
4343
4444 func keyNftData (assetIdStr) = (("nft_" + assetIdStr) + "_data")
4545
4646
4747 func keyNftImage (assetIdStr) = (("nft_" + assetIdStr) + "_image")
4848
4949
5050 func keyNftIssuer (assetIdStr) = (("nft_" + assetIdStr) + "_issuer")
5151
5252
5353 func keyNftMeta (assetIdStr) = (("nft_" + assetIdStr) + "_meta")
5454
5555
5656 func keyNftIsEditable (assetIdStr) = (("nft_" + assetIdStr) + "_isEditable")
5757
5858
5959 func keyNftCollection (assetIdStr) = (("nft_" + assetIdStr) + "_collection")
6060
6161
6262 @Callable(i)
6363 func createCollection (name,URITemplate) = if ((indexOf(URITemplate, "https://") != 0))
6464 then throw("URI Template is required")
6565 else if ((1 > value(indexOf(URITemplate, "{{ID}}"))))
6666 then throw("ID parameter in URI Template is required")
6767 else {
6868 let collectionId = toBase58String(i.transactionId)
6969 [StringEntry(keyCollectionName(collectionId), name), StringEntry(keyURITemplate(collectionId), URITemplate), IntegerEntry(keyCollectionSize(collectionId), 0), StringEntry(keyCollectionOwner(collectionId), toBase58String(i.originCallerPublicKey))]
7070 }
7171
7272
7373
7474 @Callable(i)
7575 func createNFT (name,desc,image,collectionId,meta,editable,sendTo) = {
7676 let collectionOwner = tryGetString(keyCollectionOwner(collectionId))
7777 if ((toBase58String(i.callerPublicKey) != collectionOwner))
7878 then throw("this NFT can be updated only by the collection owner")
7979 else if ((indexOf(image, "https://") != 0))
8080 then throw("https link to image is required")
8181 else {
8282 let asset = Issue(name, desc, 1, 0, false, unit, 0)
8383 let assetId = calculateAssetId(asset)
8484 let assetIdStr = toBase58String(assetId)
8585 let collectionIdChecked = ((toString(i.caller) + "_") + (if ((size(collectionId) > 0))
8686 then collectionId
8787 else "basic"))
8888 let nftNum = (tryGetInteger(keyCollectionSize(collectionIdChecked)) + 1)
8989 $Tuple2([StringEntry(keyNftData(assetIdStr), (((("{'collection': '" + collectionId) + "', 'num': ") + toString(nftNum)) + "}")), StringEntry(keyNftImage(assetIdStr), image), StringEntry(keyNftIssuer(assetIdStr), toString(i.caller)), BooleanEntry(keyNftIsEditable(assetIdStr), editable), StringEntry(keyNftCollection(assetIdStr), collectionId), StringEntry(keyNftMeta(assetIdStr), meta), IntegerEntry(keyCollectionSize(collectionId), nftNum), StringEntry(keyCollectionAssetId(collectionId, assetIdStr), assetIdStr), asset, ScriptTransfer(if ((sendTo == ""))
9090 then i.caller
9191 else addressFromStringValue(sendTo), 1, assetId)], assetIdStr)
9292 }
9393 }
9494
9595
9696
9797 @Callable(i)
9898 func updateNFTMeta (assetIdStr,meta) = {
9999 let asset = value(assetInfo(fromBase58String(assetIdStr)))
100100 let isEditable = match getBoolean(this, keyNftIsEditable(assetIdStr)) {
101101 case x: Boolean =>
102102 x
103103 case _ =>
104104 false
105105 }
106106 let collectionIdStr = tryGetString(keyNftCollection(assetIdStr))
107107 let collectionOwner = tryGetString(keyCollectionOwner(collectionIdStr))
108108 if (!(isEditable))
109109 then throw("this NFT can't be updated")
110110 else if ((toBase58String(i.callerPublicKey) != collectionOwner))
111111 then throw("this NFT can be updated only by the collection owner")
112112 else [StringEntry(keyNftMeta(assetIdStr), meta)]
113113 }
114114
115115
116+
117+@Callable(i)
118+func testWithAttachment () = [IntegerEntry((toBase58String(i.transactionId) + "_paid"), i.payments[0].amount)]
119+
120+
116121 @Verifier(tx)
117122 func verify () = sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey)
118123

github/deemru/w8io/6500d08 
38.25 ms