tx · 6jJwfeyjCmZ7SMERF9vngfQiWN5pZmMhQo9wdj87Ma1j

3N4boZRUJ2LxY5jLyp6hmxGktqnawQidu6H:  -0.01000000 Waves

2022.11.11 09:59 [2312155] smart account 3N4boZRUJ2LxY5jLyp6hmxGktqnawQidu6H > SELF 0.00000000 Waves

{ "type": 13, "id": "6jJwfeyjCmZ7SMERF9vngfQiWN5pZmMhQo9wdj87Ma1j", "fee": 1000000, "feeAssetId": null, "timestamp": 1668149946033, "version": 2, "chainId": 84, "sender": "3N4boZRUJ2LxY5jLyp6hmxGktqnawQidu6H", "senderPublicKey": "BDeCphaaC4MZvfmbJqQZ78EvuEBZTJ1VEW7fbxue8BUu", "proofs": [ "5H3exnrQyHXzmGnY9eAWdo2wNzfpXhkgyhZk24yQ3B6Axy3nXuWQvRS8Pgz5r3ovTB6XbXjNgodXB9XpezV4SCPb" ], "script": "base64:BgISCAISBAoCCAgSAwoBCBIDCgEBBQAJc2VwYXJhdG9yAgFfAARrQnV5AgNidXkABWtTZWxsAgRzZWxsAAZrUHJpY2UCBXByaWNlAQVpc05mdAEHYXNzZXRJZAQHJG1hdGNoMAkA7AcBBQdhc3NldElkAwkAAQIFByRtYXRjaDACBUFzc2V0BAV0b2tlbgUHJG1hdGNoMAMDCQAAAggFBXRva2VuCGRlY2ltYWxzAAAJAAACCAUFdG9rZW4IcXVhbnRpdHkAAQcJAAACCAUFdG9rZW4KcmVpc3N1YWJsZQcHBwMBaQEIaXNzdWVOZnQCBG5hbWUEbWV0YQQIbmV3VG9rZW4JAMIIBQUEbmFtZQUEbWV0YQABAAAHBAdpc3N1ZUlkCQC4CAEFCG5ld1Rva2VuCQDMCAIFCG5ld1Rva2VuCQDMCAIJAQ5TY3JpcHRUcmFuc2ZlcgMIBQFpBmNhbGxlcgABBQdpc3N1ZUlkCQDMCAIJAQtTdHJpbmdFbnRyeQIJAKwCAgkArAICCQDYBAEFB2lzc3VlSWQFCXNlcGFyYXRvcgIFT3duZXIJAKUIAQgFAW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xNDgzAl8yAwkBASEBCQEFaXNOZnQBBQZ0b2tlbjAJAAIBAhBUb2tlbiBpcyBub3QgTkZUCQDMCAIJAQtTdHJpbmdFbnRyeQIJAKwCAgkArAICBQZrUHJpY2UFCXNlcGFyYXRvcgkA2AQBCQEFdmFsdWUBCAkAkQMCCAUBaQhwYXltZW50cwAAB2Fzc2V0SWQJAKQDAQUFcHJpY2UJAMwIAgkBDlNjcmlwdFRyYW5zZmVyAwgFAWkGY2FsbGVyAAEJAQV2YWx1ZQEICQCRAwIIBQFpCHBheW1lbnRzAAAHYXNzZXRJZAkAzAgCCQELU3RyaW5nRW50cnkCCQCsAgIJAKwCAgkApQgBCAUBaQZjYWxsZXIFCXNlcGFyYXRvcgUFa1NlbGwJAKwCAgkArAICCQDYBAEFBnRva2VuMAUJc2VwYXJhdG9yCQCkAwEFB2Ftb3VudDAFA25pbAAxfJi2", "height": 2312155, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: JBHvKDnQMeu2kpZQV5Ypg6Pkvx4RgtGeRUCYLsb8ysky Next: EcxZeLzmt4g7gXgLDKVKYjy5N3iiZzKPWZtH1RUkYV8r Diff:
OldNewDifferences
2525
2626
2727 @Callable(i)
28-func issueNft (j,k,l) = {
29- let m = Issue(j, k, 1, 0, false)
30- let n = calculateAssetId(m)
31-[m, StringEntry(((d + a) + toBase58String(n)), toString(l))]
28+func issueNft (j,k) = {
29+ let l = Issue(j, k, 1, 0, false)
30+ let m = calculateAssetId(l)
31+[l, ScriptTransfer(i.caller, 1, m), StringEntry(((toBase58String(m) + a) + "Owner"), toString(i.caller))]
3232 }
3333
3434
3535
3636 @Callable(i)
37-func buyNFT (o) = {
38- let f = fromBase58String(o)
39- let p = value(i.payments[0].amount)
40- let l = valueOrErrorMessage(getString(((d + a) + o)), "There is no price for this NFT")
37+func buyNFT (n) = {
38+ let f = fromBase58String(n)
39+ let o = value(i.payments[0].amount)
40+ let p = valueOrErrorMessage(getString(((d + a) + n)), "There is no price for this NFT")
41+ let q = valueOrErrorMessage(getStringValue(((n + a) + "Owner")), "No owner")
4142 if ((i.payments[0].assetId != unit))
4243 then throw("Pay in waves")
43- else if ((parseIntValue(l) > p))
44+ else if ((parseIntValue(p) > o))
4445 then throw("Invalid payment")
45- else [ScriptTransfer(i.caller, 1, f), StringEntry(((toString(i.caller) + a) + b), ((o + a) + toString(p)))]
46+ else [ScriptTransfer(i.caller, 1, f), ScriptTransfer(value(addressFromString(q)), parseIntValue(p), unit), StringEntry(((toString(i.caller) + a) + b), ((n + a) + toString(o)))]
4647 }
4748
4849
4950
5051 @Callable(i)
51-func sellNFT () = {
52- let q = $Tuple2(value(i.payments[0].assetId), value(i.payments[0].amount))
53- let r = q._1
54- let s = q._2
55- let l = getStringValue(((d + a) + valueOrErrorMessage(toBase58String(r), "There is no price for this NFT")))
56- if (!(e(r)))
52+func sellNFT (p) = {
53+ let r = $Tuple2(value(i.payments[0].assetId), value(i.payments[0].amount))
54+ let s = r._1
55+ let t = r._2
56+ if (!(e(s)))
5757 then throw("Token is not NFT")
58- else [ScriptTransfer(i.caller, parseIntValue(l), unit), StringEntry(((toString(i.caller) + a) + c), ((toBase58String(r) + a) + toString(s)))]
58+ else [StringEntry(((d + a) + toBase58String(value(i.payments[0].assetId))), toString(p)), ScriptTransfer(i.caller, 1, value(i.payments[0].assetId)), StringEntry(((toString(i.caller) + a) + c), ((toBase58String(s) + a) + toString(t)))]
5959 }
6060
6161
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 = "sell"
99
1010 let d = "price"
1111
1212 func e (f) = {
1313 let g = assetInfo(f)
1414 if ($isInstanceOf(g, "Asset"))
1515 then {
1616 let h = g
1717 if (if ((h.decimals == 0))
1818 then (h.quantity == 1)
1919 else false)
2020 then (h.reissuable == false)
2121 else false
2222 }
2323 else false
2424 }
2525
2626
2727 @Callable(i)
28-func issueNft (j,k,l) = {
29- let m = Issue(j, k, 1, 0, false)
30- let n = calculateAssetId(m)
31-[m, StringEntry(((d + a) + toBase58String(n)), toString(l))]
28+func issueNft (j,k) = {
29+ let l = Issue(j, k, 1, 0, false)
30+ let m = calculateAssetId(l)
31+[l, ScriptTransfer(i.caller, 1, m), StringEntry(((toBase58String(m) + a) + "Owner"), toString(i.caller))]
3232 }
3333
3434
3535
3636 @Callable(i)
37-func buyNFT (o) = {
38- let f = fromBase58String(o)
39- let p = value(i.payments[0].amount)
40- let l = valueOrErrorMessage(getString(((d + a) + o)), "There is no price for this NFT")
37+func buyNFT (n) = {
38+ let f = fromBase58String(n)
39+ let o = value(i.payments[0].amount)
40+ let p = valueOrErrorMessage(getString(((d + a) + n)), "There is no price for this NFT")
41+ let q = valueOrErrorMessage(getStringValue(((n + a) + "Owner")), "No owner")
4142 if ((i.payments[0].assetId != unit))
4243 then throw("Pay in waves")
43- else if ((parseIntValue(l) > p))
44+ else if ((parseIntValue(p) > o))
4445 then throw("Invalid payment")
45- else [ScriptTransfer(i.caller, 1, f), StringEntry(((toString(i.caller) + a) + b), ((o + a) + toString(p)))]
46+ else [ScriptTransfer(i.caller, 1, f), ScriptTransfer(value(addressFromString(q)), parseIntValue(p), unit), StringEntry(((toString(i.caller) + a) + b), ((n + a) + toString(o)))]
4647 }
4748
4849
4950
5051 @Callable(i)
51-func sellNFT () = {
52- let q = $Tuple2(value(i.payments[0].assetId), value(i.payments[0].amount))
53- let r = q._1
54- let s = q._2
55- let l = getStringValue(((d + a) + valueOrErrorMessage(toBase58String(r), "There is no price for this NFT")))
56- if (!(e(r)))
52+func sellNFT (p) = {
53+ let r = $Tuple2(value(i.payments[0].assetId), value(i.payments[0].amount))
54+ let s = r._1
55+ let t = r._2
56+ if (!(e(s)))
5757 then throw("Token is not NFT")
58- else [ScriptTransfer(i.caller, parseIntValue(l), unit), StringEntry(((toString(i.caller) + a) + c), ((toBase58String(r) + a) + toString(s)))]
58+ else [StringEntry(((d + a) + toBase58String(value(i.payments[0].assetId))), toString(p)), ScriptTransfer(i.caller, 1, value(i.payments[0].assetId)), StringEntry(((toString(i.caller) + a) + c), ((toBase58String(s) + a) + toString(t)))]
5959 }
6060
6161

github/deemru/w8io/026f985 
296.12 ms