tx · FP4VaqVD8u1zKawTuXvCFN194CogX8gwq7GsMrSAEWuZ

3PPgeYTWMRZ7S7jSLpnVuKKB9r6XuDk3ndC:  -0.01400000 Waves

2022.02.22 06:16 [2999391] smart account 3PPgeYTWMRZ7S7jSLpnVuKKB9r6XuDk3ndC > SELF 0.00000000 Waves

{ "type": 13, "id": "FP4VaqVD8u1zKawTuXvCFN194CogX8gwq7GsMrSAEWuZ", "fee": 1400000, "feeAssetId": null, "timestamp": 1645499790344, "version": 2, "chainId": 87, "sender": "3PPgeYTWMRZ7S7jSLpnVuKKB9r6XuDk3ndC", "senderPublicKey": "AWoQVon5Ld79iWytFLN2MSSJr9ow7XEMVaH8emaRJp3Z", "proofs": [ "4DG7zkXr2aAoJWnnEu9TENxFvqQ33TEqzkficGrhEsZdDqUEo74NcdwUsaoTwFpZDaM8gMdrbnFWddXiUbJUMPgf" ], "script": "base64:AAIFAAAAAAAAAAwIAhIAEgASBAoCAQgAAAAEAAAAABJuZnRDcmVhdGlvbkFkZHJlc3MBAAAAGgFXRkeg0dLB5XqqDtLD9Tumwl0uvsvI4tRyAAAAABZzaWduQXJ0Q29udHJhY3RBZGRyZXNzAQAAABoBV3tk1VvWnhe5qtPmj/wDXMjEFvibuoYp4gAAAAAabWFya2V0cGxhY2VDb250cmFjdEFkZHJlc3MBAAAAGgFXXYvxX8soIGsfZqPIbtoLqJftD+j9yUTxAQAAAAhjaGVja05GVAAAAAIAAAAFYXNzZXQAAAANaXNzdWVyQWRkcmVzcwMDAwkAAAAAAAACCAgFAAAABWFzc2V0AAAABmlzc3VlcgAAAAVieXRlcwUAAAANaXNzdWVyQWRkcmVzcwkAAAAAAAACCAUAAAAFYXNzZXQAAAAIZGVjaW1hbHMAAAAAAAAAAAAHCQAAAAAAAAIIBQAAAAVhc3NldAAAAApyZWlzc3VhYmxlBwcJAAAAAAAAAggFAAAABWFzc2V0AAAACHF1YW50aXR5AAAAAAAAAAABBwAAAAMAAAABaQEAAAALbG9ja1NpZ25Bc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3V0QXNzZXRJZAQAAAAOc3Rha2VkTkZUSWRTdHIEAAAAByRtYXRjaDAJAAP8AAAABAUAAAAEdGhpcwIAAAALbG9ja1NpZ25BcnQFAAAAA25pbAkABEwAAAACCQABkQAAAAIIBQAAAAFpAAAACHBheW1lbnRzAAAAAAAAAAAABQAAAANuaWwDCQAAAQAAAAIFAAAAByRtYXRjaDACAAAABlN0cmluZwQAAAABcwUAAAAHJG1hdGNoMAUAAAABcwkAAAIAAAABAgAAACRTb210aGluZyB3cm9uZyB3aGVuIGxvY2sgU2lnbkFydCBORlQDCQAAAAAAAAIFAAAADnN0YWtlZE5GVElkU3RyBQAAAA5zdGFrZWRORlRJZFN0cgMJAABmAAAAAgkAATEAAAABBQAAAA5zdGFrZWRORlRJZFN0cgAAAAAAAAAAAAQAAAAHJG1hdGNoMAkAA/wAAAAECQEAAAAHQWRkcmVzcwAAAAEFAAAAGm1hcmtldHBsYWNlQ29udHJhY3RBZGRyZXNzAgAAAAdzZWxsTkZUCQAETAAAAAIFAAAAC2J1eU91dFByaWNlCQAETAAAAAIFAAAADWJ1eU91dEFzc2V0SWQFAAAAA25pbAkABEwAAAACCQEAAAAPQXR0YWNoZWRQYXltZW50AAAAAgkAAlkAAAABBQAAAA5zdGFrZWRORlRJZFN0cgAAAAAAAAAAAQUAAAADbmlsBQAAAANuaWwJAAACAAAAAQIAAAATSW52YWxpZCBjcmVhdGVkIE5GVAkAAAIAAAABAgAAACRTdHJpY3QgdmFsdWUgaXMgbm90IGVxdWFsIHRvIGl0c2VsZi4AAAABAAAAAnR4AQAAAAZ2ZXJpZnkAAAAACQAB9AAAAAMIBQAAAAJ0eAAAAAlib2R5Qnl0ZXMJAAGRAAAAAggFAAAAAnR4AAAABnByb29mcwAAAAAAAAAAAAgFAAAAAnR4AAAAD3NlbmRlclB1YmxpY0tleWNIm1k=", "height": 2999391, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 5cakqHAqShjpUpBsUhQULjV9fbbfeXapvRiSNKiDgeab Next: FGnzGUWmsuFFqdXGeBLjDywFuFAphfsvXwMzEcjrGfwz Diff:
OldNewDifferences
44 let nftCreationAddress = base58'3P8LVqVKhTViMJau96KNir6FhHr4WnfoW57'
55
66 let signArtContractAddress = base58'3PDBLdsUrcsiPxNbt8g2gQVoefKgzt3kJzV'
7+
8+let marketplaceContractAddress = base58'3PATXDVE53rKJtkwXYV3tvuLVS2fDtGtKCc'
79
810 func checkNFT (asset,issuerAddress) = if (if (if ((asset.issuer.bytes == issuerAddress))
911 then (asset.decimals == 0)
4244 case x: String =>
4345 x
4446 case _ =>
45- throw("something went wrong during creation of NFT")
47+ throw("Something went wrong during creation of NFT")
4648 }
4749 if ((stakedNFTIdStr == stakedNFTIdStr))
48- then [ScriptTransfer(i.caller, 1, fromBase58String(stakedNFTIdStr)), StringEntry((("signArtNft_" + toBase58String(assetId)) + "_owner"), addressStr), StringEntry((("signArtNft_" + stakedNFTIdStr) + "_assetId"), toBase58String(assetId))]
50+ then $Tuple2([ScriptTransfer(i.caller, 1, fromBase58String(stakedNFTIdStr)), StringEntry((("signArtNft_" + toBase58String(assetId)) + "_owner"), addressStr), StringEntry((("signArtNft_" + stakedNFTIdStr) + "_assetId"), toBase58String(assetId))], stakedNFTIdStr)
4951 else throw("Strict value is not equal to itself.")
5052 }
5153 else throw("Wrong data for create NFT")
7880 }
7981
8082
83+
84+@Callable(i)
85+func lockAndSellNFT (buyOutPrice,buyOutAssetId) = {
86+ let stakedNFTIdStr = match invoke(this, "lockSignArt", nil, [i.payments[0]]) {
87+ case s: String =>
88+ s
89+ case _ =>
90+ throw("Somthing wrong when lock SignArt NFT")
91+ }
92+ if ((stakedNFTIdStr == stakedNFTIdStr))
93+ then if ((size(stakedNFTIdStr) > 0))
94+ then match invoke(Address(marketplaceContractAddress), "sellNFT", [buyOutPrice, buyOutAssetId], [AttachedPayment(fromBase58String(stakedNFTIdStr), 1)]) {
95+ case _ =>
96+ nil
97+ }
98+ else throw("Invalid created NFT")
99+ else throw("Strict value is not equal to itself.")
100+ }
101+
102+
81103 @Verifier(tx)
82104 func verify () = sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey)
83105
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 5 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let nftCreationAddress = base58'3P8LVqVKhTViMJau96KNir6FhHr4WnfoW57'
55
66 let signArtContractAddress = base58'3PDBLdsUrcsiPxNbt8g2gQVoefKgzt3kJzV'
7+
8+let marketplaceContractAddress = base58'3PATXDVE53rKJtkwXYV3tvuLVS2fDtGtKCc'
79
810 func checkNFT (asset,issuerAddress) = if (if (if ((asset.issuer.bytes == issuerAddress))
911 then (asset.decimals == 0)
1012 else false)
1113 then (asset.reissuable == false)
1214 else false)
1315 then (asset.quantity == 1)
1416 else false
1517
1618
1719 @Callable(i)
1820 func lockSignArt () = {
1921 let addressStr = toString(i.caller)
2022 let assetId = value(value(i.payments[0]).assetId)
2123 let asset = value(assetInfo(assetId))
2224 let assetDesc = asset.description
2325 if (if ((value(i.payments[0]).amount == 1))
2426 then checkNFT(asset, signArtContractAddress)
2527 else false)
2628 then {
2729 let partsOfString = split(assetDesc, ",")
2830 let creatorStr = drop(split(partsOfString[0], ":")[1], 1)
2931 let artIdStr = drop(split(partsOfString[1], ":")[1], 1)
3032 let name = getStringValue(Address(signArtContractAddress), ((("art_name_" + artIdStr) + "_") + creatorStr))
3133 let artDesc = getStringValue(Address(signArtContractAddress), ((("art_desc_" + artIdStr) + "_") + creatorStr))
3234 let artUrl = getStringValue(Address(signArtContractAddress), ((("art_display_cid_" + artIdStr) + "_") + creatorStr))
3335 let desc = if ((size(artDesc) > 0))
3436 then artDesc
3537 else "NFT from signArt"
3638 let imageLink = ("https://ipfs.io/ipfs/" + artUrl)
3739 if (if ((size(name) > 0))
3840 then (size(artUrl) > 0)
3941 else false)
4042 then {
4143 let stakedNFTIdStr = match invoke(Address(nftCreationAddress), "createNFT", [take(name, 16), desc, imageLink, "signArt"], nil) {
4244 case x: String =>
4345 x
4446 case _ =>
45- throw("something went wrong during creation of NFT")
47+ throw("Something went wrong during creation of NFT")
4648 }
4749 if ((stakedNFTIdStr == stakedNFTIdStr))
48- then [ScriptTransfer(i.caller, 1, fromBase58String(stakedNFTIdStr)), StringEntry((("signArtNft_" + toBase58String(assetId)) + "_owner"), addressStr), StringEntry((("signArtNft_" + stakedNFTIdStr) + "_assetId"), toBase58String(assetId))]
50+ then $Tuple2([ScriptTransfer(i.caller, 1, fromBase58String(stakedNFTIdStr)), StringEntry((("signArtNft_" + toBase58String(assetId)) + "_owner"), addressStr), StringEntry((("signArtNft_" + stakedNFTIdStr) + "_assetId"), toBase58String(assetId))], stakedNFTIdStr)
4951 else throw("Strict value is not equal to itself.")
5052 }
5153 else throw("Wrong data for create NFT")
5254 }
5355 else throw("Ivalid NFT attached")
5456 }
5557
5658
5759
5860 @Callable(i)
5961 func unlockSignArt () = {
6062 let addressStr = toString(i.caller)
6163 let stakedNFTId = value(value(i.payments[0]).assetId)
6264 let stakedNFTAsset = value(assetInfo(stakedNFTId))
6365 if (if ((value(i.payments[0]).amount == 1))
6466 then true
6567 else checkNFT(stakedNFTAsset, nftCreationAddress))
6668 then {
6769 let stakedNFTIdStr = toBase58String(stakedNFTAsset.id)
6870 let assetIdStr = getStringValue((("signArtNft_" + stakedNFTIdStr) + "_assetId"))
6971 let ownerStr = getStringValue((("signArtNft_" + assetIdStr) + "_owner"))
7072 let assetId = fromBase58String(assetIdStr)
7173 if (if ((size(ownerStr) > 0))
7274 then (ownerStr == addressStr)
7375 else false)
7476 then [ScriptTransfer(i.caller, 1, assetId), Burn(stakedNFTId, 1), DeleteEntry((("signArtNft_" + stakedNFTIdStr) + "_assetId")), DeleteEntry((("signArtNft_" + assetIdStr) + "_owner"))]
7577 else throw("This NFT is not yours")
7678 }
7779 else throw("Ivalid NFT attached")
7880 }
7981
8082
83+
84+@Callable(i)
85+func lockAndSellNFT (buyOutPrice,buyOutAssetId) = {
86+ let stakedNFTIdStr = match invoke(this, "lockSignArt", nil, [i.payments[0]]) {
87+ case s: String =>
88+ s
89+ case _ =>
90+ throw("Somthing wrong when lock SignArt NFT")
91+ }
92+ if ((stakedNFTIdStr == stakedNFTIdStr))
93+ then if ((size(stakedNFTIdStr) > 0))
94+ then match invoke(Address(marketplaceContractAddress), "sellNFT", [buyOutPrice, buyOutAssetId], [AttachedPayment(fromBase58String(stakedNFTIdStr), 1)]) {
95+ case _ =>
96+ nil
97+ }
98+ else throw("Invalid created NFT")
99+ else throw("Strict value is not equal to itself.")
100+ }
101+
102+
81103 @Verifier(tx)
82104 func verify () = sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey)
83105

github/deemru/w8io/026f985 
42.97 ms