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:
Old | New | Differences | |
---|---|---|---|
25 | 25 | ||
26 | 26 | ||
27 | 27 | @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))] | |
59 | 32 | } | |
60 | 33 | ||
61 | 34 |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 6 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let a = "_" | |
5 | 5 | ||
6 | 6 | let b = "buy" | |
7 | 7 | ||
8 | 8 | let c = "sell" | |
9 | 9 | ||
10 | 10 | let d = "price" | |
11 | 11 | ||
12 | 12 | func e (f) = { | |
13 | 13 | let g = assetInfo(f) | |
14 | 14 | if ($isInstanceOf(g, "Asset")) | |
15 | 15 | then { | |
16 | 16 | let h = g | |
17 | 17 | if (if ((h.decimals == 0)) | |
18 | 18 | then (h.quantity == 1) | |
19 | 19 | else false) | |
20 | 20 | then (h.reissuable == false) | |
21 | 21 | else false | |
22 | 22 | } | |
23 | 23 | else false | |
24 | 24 | } | |
25 | 25 | ||
26 | 26 | ||
27 | 27 | @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))] | |
59 | 32 | } | |
60 | 33 | ||
61 | 34 |
github/deemru/w8io/026f985 24.66 ms ◑