tx · F7WLkbPxZwuAt7Btq8SbePaDv8FYY42x9hzTKfVnfb3C

3N72SETEKtTuaA3YNVYWgVEmXKrRrZYXHGo:  -0.01000000 Waves

2022.11.16 14:16 [2319597] smart account 3N72SETEKtTuaA3YNVYWgVEmXKrRrZYXHGo > SELF 0.00000000 Waves

{ "type": 13, "id": "F7WLkbPxZwuAt7Btq8SbePaDv8FYY42x9hzTKfVnfb3C", "fee": 1000000, "feeAssetId": null, "timestamp": 1668597095013, "version": 2, "chainId": 84, "sender": "3N72SETEKtTuaA3YNVYWgVEmXKrRrZYXHGo", "senderPublicKey": "Kwu4LYBMntApXv8t7csxV23Kvc3tvak26wMKK56tA4V", "proofs": [ "xZyxsaPQcTR8vBFuwKFeZ4ac6dHuTu4paKz5RL6WymNtLS1ApJfBJvJM4cn4esN97sAaJf3Qr9rM3KXgo18yyBy" ], "script": "base64:BgIPCAISCwoJCAgICAgBCAgIBQAJc2VwYXJhdG9yAgFfAARrQnV5AgNidXkABWtTZWxsAgRzZWxsAAZrUHJpY2UCBXByaWNlAQVpc05mdAEHYXNzZXRJZAQHJG1hdGNoMAkA7AcBBQdhc3NldElkAwkAAQIFByRtYXRjaDACBUFzc2V0BAV0b2tlbgUHJG1hdGNoMAMDCQAAAggFBXRva2VuCGRlY2ltYWxzAAAJAAACCAUFdG9rZW4IcXVhbnRpdHkAAQcJAAACCAUFdG9rZW4KcmVpc3N1YWJsZQcHBwEBaQEIaXNzdWVOZnQJCG5mdF9uYW1lCW5mdF9vd25lcg9uZnRfZEFwcEFkZHJlc3MIbmZ0X3R5cGUIbmZ0X3RhZ3MRbmZ0X3NlbGxpbmdfcHJpY2UPbmZ0X2Rlc2NyaXB0aW9uCm5mdF9vblNlbGwIbmZ0X2RhdGEECG5ld1Rva2VuCQDCCAUFCG5mdF9uYW1lBQ9uZnRfZGVzY3JpcHRpb24AAQAABwQHaXNzdWVJZAkAuAgBBQhuZXdUb2tlbgkAzAgCBQhuZXdUb2tlbgkAzAgCCQELU3RyaW5nRW50cnkCCQCsAgIJAKwCAgkA2AQBBQdpc3N1ZUlkBQlzZXBhcmF0b3ICCW5mdF9vd25lcgkApQgBCAUBaQZjYWxsZXIJAMwIAgkBC1N0cmluZ0VudHJ5AgkArAICCQCsAgIJANgEAQUHaXNzdWVJZAUJc2VwYXJhdG9yAghuZnRfdHlwZQUIbmZ0X3R5cGUJAMwIAgkBC1N0cmluZ0VudHJ5AgkArAICCQCsAgIJANgEAQUHaXNzdWVJZAUJc2VwYXJhdG9yAghuZnRfdGFncwUIbmZ0X3RhZ3MJAMwIAgkBC1N0cmluZ0VudHJ5AgkArAICCQCsAgIJANgEAQUHaXNzdWVJZAUJc2VwYXJhdG9yAg9uZnRfZEFwcEFkZHJlc3MFD25mdF9kQXBwQWRkcmVzcwkAzAgCCQEMSW50ZWdlckVudHJ5AgkArAICCQCsAgIJANgEAQUHaXNzdWVJZAUJc2VwYXJhdG9yAhFuZnRfc2VsbGluZ19wcmljZQURbmZ0X3NlbGxpbmdfcHJpY2UJAMwIAgkBC1N0cmluZ0VudHJ5AgkArAICCQCsAgIJANgEAQUHaXNzdWVJZAUJc2VwYXJhdG9yAgpuZnRfb25TZWxsBQpuZnRfb25TZWxsCQDMCAIJAQtTdHJpbmdFbnRyeQIJAKwCAgkArAICCQDYBAEFB2lzc3VlSWQFCXNlcGFyYXRvcgIIbmZ0X2RhdGEFCG5mdF9kYXRhCQDMCAIJAQtTdHJpbmdFbnRyeQIJAKwCAgkArAICCQDYBAEFB2lzc3VlSWQFCXNlcGFyYXRvcgIOaXNzdWVOZnRUb1VzZXIJANwEAQUHaXNzdWVJZAUDbmlsAD9OagY=", "height": 2319597, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 9xZ3FGXVbxNqSkDzPTjUS1S1UhUiq9DcnGLbuAGPkzks Next: H59DAQKCN8HtqrBsTMMiDFFwwUa3fdjnPVU1bMXUnhw2 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))]
32- }
33-
34-
35-
36-@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")
41- if ((i.payments[0].assetId != unit))
42- then throw("pay in waves")
43- else if ((parseIntValue(l) > p))
44- then throw("Invalid payment")
45- else [ScriptTransfer(i.caller, 1, f), StringEntry(((toString(i.caller) + a) + b), ((o + a) + toString(p)))]
46- }
47-
48-
49-
50-@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)))
57- 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)))]
28+func issueNft (j,k,l,m,n,o,p,q,r) = {
29+ let s = Issue(j, p, 1, 0, false)
30+ let t = calculateAssetId(s)
31+[s, StringEntry(((toBase58String(t) + a) + "nft_owner"), toString(i.caller)), StringEntry(((toBase58String(t) + a) + "nft_type"), m), StringEntry(((toBase58String(t) + a) + "nft_tags"), n), StringEntry(((toBase58String(t) + a) + "nft_dAppAddress"), l), IntegerEntry(((toBase58String(t) + a) + "nft_selling_price"), o), StringEntry(((toBase58String(t) + a) + "nft_onSell"), q), StringEntry(((toBase58String(t) + a) + "nft_data"), r), StringEntry(((toBase58String(t) + a) + "issueNftToUser"), toBase16String(t))]
5932 }
6033
6134
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))]
32- }
33-
34-
35-
36-@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")
41- if ((i.payments[0].assetId != unit))
42- then throw("pay in waves")
43- else if ((parseIntValue(l) > p))
44- then throw("Invalid payment")
45- else [ScriptTransfer(i.caller, 1, f), StringEntry(((toString(i.caller) + a) + b), ((o + a) + toString(p)))]
46- }
47-
48-
49-
50-@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)))
57- 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)))]
28+func issueNft (j,k,l,m,n,o,p,q,r) = {
29+ let s = Issue(j, p, 1, 0, false)
30+ let t = calculateAssetId(s)
31+[s, StringEntry(((toBase58String(t) + a) + "nft_owner"), toString(i.caller)), StringEntry(((toBase58String(t) + a) + "nft_type"), m), StringEntry(((toBase58String(t) + a) + "nft_tags"), n), StringEntry(((toBase58String(t) + a) + "nft_dAppAddress"), l), IntegerEntry(((toBase58String(t) + a) + "nft_selling_price"), o), StringEntry(((toBase58String(t) + a) + "nft_onSell"), q), StringEntry(((toBase58String(t) + a) + "nft_data"), r), StringEntry(((toBase58String(t) + a) + "issueNftToUser"), toBase16String(t))]
5932 }
6033
6134

github/deemru/w8io/026f985 
24.66 ms