tx · EsfxQBViRrTj1h7CuRstCtcmRT9pfYTSmMTsxd1hFVRL

3NBYw8rxLmTvyEdsvaYor8nHG6GJ4NjB2Aw:  -0.01000000 Waves

2023.01.24 13:44 [2418941] smart account 3NBYw8rxLmTvyEdsvaYor8nHG6GJ4NjB2Aw > SELF 0.00000000 Waves

{ "type": 13, "id": "EsfxQBViRrTj1h7CuRstCtcmRT9pfYTSmMTsxd1hFVRL", "fee": 1000000, "feeAssetId": null, "timestamp": 1674557135894, "version": 2, "chainId": 84, "sender": "3NBYw8rxLmTvyEdsvaYor8nHG6GJ4NjB2Aw", "senderPublicKey": "4NDsd3dGKXuKLCoSbYvcWCX276K9ShP75cs9HTBMLJEN", "proofs": [ "5moF8FZEt44Esxkipgqv2YvkRN1xgXL2XfMaeSVqwjrJqAZQAHynVDEzwnXEbLJu2rCpzf1wgyyLMnPJGXxwnnsU" ], "script": "base64:BgIfCAISCwoJCAgICAgBCAgIEgMKAQgSBAoCCAgSAwoBCAsACXNlcGFyYXRvcgIBXwAEa0J1eQIDYnV5AAZrUHJpY2UCBXByaWNlAAVrU2VsbAIEc2VsbAAFdGVhbXMBIIVjlaPziI6w3gwXjghOv5o/krsm2zrodo4W3BQiKkh+AAV3YXZlcwEAABJtYXhBdWN0aW9uRHVyYXRpb24ABwAEa0JpZAIDYmlkAAxzdGF0dXNGb3JORlQJAJYKBAIET1BFTgIGQ0xPU0VEAghSRVdBUkRFRAIIQ0FOQ0VMRUQAC2RBcHBBZGRyZXNzARoBVEq4T2zewtqT7fSO6Uo2+NVPf5XVVVtdoAEFaXNOZnQBB2Fzc2V0SWQEByRtYXRjaDAJAOwHAQUHYXNzZXRJZAMJAAECBQckbWF0Y2gwAgVBc3NldAQFdG9rZW4FByRtYXRjaDADAwkAAAIIBQV0b2tlbghkZWNpbWFscwAACQAAAggFBXRva2VuCHF1YW50aXR5AAEHCQAAAggFBXRva2VuCnJlaXNzdWFibGUHBwcEAWkBCWNyZWF0ZU5mdAkIbmZ0X25h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QlzZXBhcmF0b3ICBl9vd25lcgkApQgBCAUBaQZjYWxsZXIFA25pbAkAzAgCCQEOU2NyaXB0VHJhbnNmZXIDCAUBaQZjYWxsZXIAAQUHYXNzZXRJZAkAzAgCCQEOU2NyaXB0VHJhbnNmZXIDCQEHQWRkcmVzcwEJANkEAQURY3VycmVudF9uZnRfb3duZXIFBmFtb3VudAUEdW5pdAkAzAgCCQELU3RyaW5nRW50cnkCCQCsAgIJAKwCAgkApQgBCAUBaQZjYWxsZXIFCXNlcGFyYXRvcgUEa0J1eQkArAICCQCsAgIFBW5mdElEBQlzZXBhcmF0b3IJAKQDAQUGYW1vdW50CQDMCAIJAQtEZWxldGVFbnRyeQEJAKwCAgkArAICAgRuZnRfBRFjdXJyZW50X25mdF9vd25lcgIGX293bmVyCQDMCAIJAQtTdHJpbmdFbnRyeQIJAKwCAgkArAICAgRuZnRfBRFjdXJyZW50X25mdF9vd25lcgIGX293bmVyCQClCAEIBQFpBmNhbGxlcgkAzAgCCQELU3RyaW5nRW50cnkCCQCsAgIJAKwCAgUFbmZ0SUQFCXNlcGFyYXRvcgIGX293bmVyCQClCAEIBQFpBmNhbGxlcgUDbmlsAWkBCmNhbmNlbFNlbGwBBW5mdElkBAR0eElkCQDYBAEIBQFpDXRyYW5zYWN0aW9uSWQEBmNhbGxlcggIBQFpBmNhbGxlcgVieXRlcwQIbmZ0T3duZXIJARFAZXh0ck5hdGl2ZSgxMDUzKQIFBHRoaXMJAKwCAgUFbmZ0SWQCCl9uZnRfb3duZXIJAMwIAgkBC1N0cmluZ0VudHJ5AgkArAICCQCsAgIFBHR4SWQFBW5mdElkAgtfbmZ0X3N0YXR1cwIIQ0FOQ0VMRUQJAMwIAgkBDlNjcmlwdFRyYW5zZmVyAwkBB0FkZHJlc3MBCQDZBAEFCG5mdE93bmVyAAEJANkEAQUFbmZ0SWQFA25pbACrbevH", "height": 2418941, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: FKVricbxSRgsqAwBFoMrhN6oJbGZWKVpqFpBRXda9y1J Next: 7BZYhv6bFir3Log5Vu21xoHFyKUULaL1qUkgGpjTUoda Diff:
OldNewDifferences
7373 }
7474 else false
7575 }
76+ let L = $Tuple2(value(o.payments[0].assetId), value(o.payments[0].amount))
77+ let E = L._1
78+ let F = L._2
7679 let B = getStringValue(((((c + a) + G) + "_") + H))
7780 if ((H == toString(o.caller)))
7881 then throw("current Owner of NFT not able to purchase")
79- else if ((o.payments[0].assetId == e))
80- then [ScriptTransfer(o.caller, 1, l), ScriptTransfer(Address(fromBase58String(H)), I, e), StringEntry(((toString(o.caller) + a) + b), ((G + a) + toString(I))), DeleteEntry((("nft_" + H) + "_owner")), StringEntry((("nft_" + H) + "_owner"), toString(o.caller)), StringEntry(((G + a) + "_owner"), toString(o.caller))]
81- else [ScriptTransfer(o.caller, 1, l), ScriptTransfer(Address(fromBase58String(H)), I, unit), StringEntry(((toString(o.caller) + a) + b), ((G + a) + toString(I))), DeleteEntry((("nft_" + H) + "_owner")), StringEntry((("nft_" + H) + "_owner"), toString(o.caller)), StringEntry(((G + a) + "_owner"), toString(o.caller))]
82+ else if (!(k(E)))
83+ then throw("Token is not NFT")
84+ else if ((o.payments[0].assetId == e))
85+ then [ScriptTransfer(o.caller, 1, l), ScriptTransfer(Address(fromBase58String(H)), I, e), StringEntry(((toString(o.caller) + a) + b), ((G + a) + toString(I))), DeleteEntry((("nft_" + H) + "_owner")), StringEntry((("nft_" + H) + "_owner"), toString(o.caller)), StringEntry(((G + a) + "_owner"), toString(o.caller))]
86+ else [ScriptTransfer(o.caller, 1, l), ScriptTransfer(Address(fromBase58String(H)), I, unit), StringEntry(((toString(o.caller) + a) + b), ((G + a) + toString(I))), DeleteEntry((("nft_" + H) + "_owner")), StringEntry((("nft_" + H) + "_owner"), toString(o.caller)), StringEntry(((G + a) + "_owner"), toString(o.caller))]
87+ }
88+
89+
90+
91+@Callable(o)
92+func cancelSell (M) = {
93+ let A = toBase58String(o.transactionId)
94+ let N = o.caller.bytes
95+ let O = getStringValue(this, (M + "_nft_owner"))
96+[StringEntry(((A + M) + "_nft_status"), "CANCELED"), ScriptTransfer(Address(fromBase58String(O)), 1, fromBase58String(M))]
8297 }
8398
8499
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 6 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let a = "_"
55
66 let b = "buy"
77
88 let c = "price"
99
1010 let d = "sell"
1111
1212 let e = base58'9yhJDfWjPpv6tFjWRD1AJyBQwausJf2ZdxzLn86Uknnq'
1313
1414 let f = base58''
1515
1616 let g = 7
1717
1818 let h = "bid"
1919
2020 let i = $Tuple4("OPEN", "CLOSED", "REWARDED", "CANCELED")
2121
2222 let j = base58'3MvjAaDYHpS4A5K4CV3kZMMEH9m9JdBSvbq'
2323
2424 func k (l) = {
2525 let m = assetInfo(l)
2626 if ($isInstanceOf(m, "Asset"))
2727 then {
2828 let n = m
2929 if (if ((n.decimals == 0))
3030 then (n.quantity == 1)
3131 else false)
3232 then (n.reissuable == false)
3333 else false
3434 }
3535 else false
3636 }
3737
3838
3939 @Callable(o)
4040 func createNft (p,q,r,s,t,u,v,w,x) = {
4141 let y = Issue(p, v, 1, 0, false)
4242 let z = calculateAssetId(y)
4343 let A = o.transactionId
4444 [y, ScriptTransfer(o.caller, 1, z), StringEntry(((toBase58String(z) + a) + "Owner"), toString(o.caller)), StringEntry(((toBase58String(z) + a) + "nft_type"), s), StringEntry(((toBase58String(z) + a) + "nft_tags"), t), StringEntry(((toBase58String(z) + a) + "nft_dAppAddress"), r), IntegerEntry(((toBase58String(z) + a) + "nft_selling_price"), u), StringEntry(((toBase58String(z) + a) + "nft_onSell"), w), StringEntry(((toBase58String(z) + a) + "nft_data"), x), StringEntry(((toBase58String(A) + a) + "issue_nft"), toBase58String(z))]
4545 }
4646
4747
4848
4949 @Callable(o)
5050 func sellNFT (B) = {
5151 let A = o.transactionId
5252 let C = o.caller.bytes
5353 let D = $Tuple2(value(o.payments[0].assetId), value(o.payments[0].amount))
5454 let E = D._1
5555 let F = D._2
5656 if (!(k(E)))
5757 then throw("Token is not NFT")
5858 else [StringEntry(((c + a) + toBase58String(value(o.payments[0].assetId))), B), StringEntry(((toString(o.caller) + a) + d), ((toBase58String(E) + a) + toString(F)))]
5959 }
6060
6161
6262
6363 @Callable(o)
6464 func buyNFT (G,H) = {
6565 let l = fromBase58String(G)
6666 let I = value(o.payments[0].amount)
6767 let J = {
6868 let m = getString(this, (("nft_" + H) + "_owner"))
6969 if ($isInstanceOf(m, "String"))
7070 then {
7171 let K = m
7272 K
7373 }
7474 else false
7575 }
76+ let L = $Tuple2(value(o.payments[0].assetId), value(o.payments[0].amount))
77+ let E = L._1
78+ let F = L._2
7679 let B = getStringValue(((((c + a) + G) + "_") + H))
7780 if ((H == toString(o.caller)))
7881 then throw("current Owner of NFT not able to purchase")
79- else if ((o.payments[0].assetId == e))
80- then [ScriptTransfer(o.caller, 1, l), ScriptTransfer(Address(fromBase58String(H)), I, e), StringEntry(((toString(o.caller) + a) + b), ((G + a) + toString(I))), DeleteEntry((("nft_" + H) + "_owner")), StringEntry((("nft_" + H) + "_owner"), toString(o.caller)), StringEntry(((G + a) + "_owner"), toString(o.caller))]
81- else [ScriptTransfer(o.caller, 1, l), ScriptTransfer(Address(fromBase58String(H)), I, unit), StringEntry(((toString(o.caller) + a) + b), ((G + a) + toString(I))), DeleteEntry((("nft_" + H) + "_owner")), StringEntry((("nft_" + H) + "_owner"), toString(o.caller)), StringEntry(((G + a) + "_owner"), toString(o.caller))]
82+ else if (!(k(E)))
83+ then throw("Token is not NFT")
84+ else if ((o.payments[0].assetId == e))
85+ then [ScriptTransfer(o.caller, 1, l), ScriptTransfer(Address(fromBase58String(H)), I, e), StringEntry(((toString(o.caller) + a) + b), ((G + a) + toString(I))), DeleteEntry((("nft_" + H) + "_owner")), StringEntry((("nft_" + H) + "_owner"), toString(o.caller)), StringEntry(((G + a) + "_owner"), toString(o.caller))]
86+ else [ScriptTransfer(o.caller, 1, l), ScriptTransfer(Address(fromBase58String(H)), I, unit), StringEntry(((toString(o.caller) + a) + b), ((G + a) + toString(I))), DeleteEntry((("nft_" + H) + "_owner")), StringEntry((("nft_" + H) + "_owner"), toString(o.caller)), StringEntry(((G + a) + "_owner"), toString(o.caller))]
87+ }
88+
89+
90+
91+@Callable(o)
92+func cancelSell (M) = {
93+ let A = toBase58String(o.transactionId)
94+ let N = o.caller.bytes
95+ let O = getStringValue(this, (M + "_nft_owner"))
96+[StringEntry(((A + M) + "_nft_status"), "CANCELED"), ScriptTransfer(Address(fromBase58String(O)), 1, fromBase58String(M))]
8297 }
8398
8499

github/deemru/w8io/026f985 
41.91 ms