tx · 9xZ3FGXVbxNqSkDzPTjUS1S1UhUiq9DcnGLbuAGPkzks

3N72SETEKtTuaA3YNVYWgVEmXKrRrZYXHGo:  -0.01000000 Waves

2022.11.10 07:20 [2310552] smart account 3N72SETEKtTuaA3YNVYWgVEmXKrRrZYXHGo > SELF 0.00000000 Waves

{ "type": 13, "id": "9xZ3FGXVbxNqSkDzPTjUS1S1UhUiq9DcnGLbuAGPkzks", "fee": 1000000, "feeAssetId": null, "timestamp": 1668053806151, "version": 2, "chainId": 84, "sender": "3N72SETEKtTuaA3YNVYWgVEmXKrRrZYXHGo", "senderPublicKey": "Kwu4LYBMntApXv8t7csxV23Kvc3tvak26wMKK56tA4V", "proofs": [ "23o2x2wgJJmQsikmxsRg1RWxT9E6EEooB4eYeeNnwy27Z4sTcYgBC8kx4nrHGAjQ7Q62rz1zH1uoYSwkTN8NRG8b" ], "script": "base64:BgIQCAISBQoDCAgBEgMKAQgSAAUACXNlcGFyYXRvcgIBXwAEa0J1eQIDYnV5AAVrU2VsbAIEc2VsbAAGa1ByaWNlAgVwcmljZQEFaXNOZnQBB2Fzc2V0SWQEByRtYXRjaDAJAOwHAQUHYXNzZXRJZAMJAAECBQckbWF0Y2gwAgVBc3NldAQFdG9rZW4FByRtYXRjaDADAwkAAAIIBQV0b2tlbghkZWNpbWFscwAACQAAAggFBXRva2VuCHF1YW50aXR5AAEHCQAAAggFBXRva2VuCnJlaXNzdWFibGUHBwcDAWkBCGlzc3VlTmZ0AwRuYW1lBG1ldGEFcHJpY2UECG5ld1Rva2VuCQDCCAUFBG5hbWUFBG1ldGEAAQAABwQHaXNzdWVJZAkAuAgBBQhuZXdUb2tlbgkAzAgCBQhuZXdUb2tlbgkAzAgCCQELU3RyaW5nRW50cnkCCQCsAgIJAKwCAgUGa1ByaWNlBQlzZXBhcmF0b3IJANgEAQUHaXNzdWVJZAkApAMBBQVwcmljZQUDbmlsAWkBBmJ1eU5GVAEFbmZ0SUQEB2Fzc2V0SWQJANkEAQUFbm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FcHJpY2UFBHVuaXQJAMwIAgkBC1N0cmluZ0VudHJ5AgkArAICCQCsAgIJAKUIAQgFAWkGY2FsbGVyBQlzZXBhcmF0b3IFBWtTZWxsCQCsAgIJAKwCAgkA2AQBBQZ0b2tlbjAFCXNlcGFyYXRvcgkApAMBBQdhbW91bnQwBQNuaWwAuZt8xw==", "height": 2310552, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: H7E5moqAsnN6YmXWFpA3weygGmgyhvb4546hCbjsyk4K Next: F7WLkbPxZwuAt7Btq8SbePaDv8FYY42x9hzTKfVnfb3C Full:
OldNewDifferences
11 {-# STDLIB_VERSION 6 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
4+let a = "_"
5+
6+let b = "buy"
7+
8+let c = "sell"
9+
10+let d = "price"
11+
12+func e (f) = {
13+ let g = assetInfo(f)
14+ if ($isInstanceOf(g, "Asset"))
15+ then {
16+ let h = g
17+ if (if ((h.decimals == 0))
18+ then (h.quantity == 1)
19+ else false)
20+ then (h.reissuable == false)
21+ else false
22+ }
23+ else false
24+ }
425
526
6-@Callable(a)
7-func buynft (b,c,d,e,f,g,h,i) = {
8- let j = a.caller
9- let k = Address(base58'3N87gU3S3GtPPo5S7dzRehArERGGJh1jwFD')
10-[IntegerEntry("amountForCreator", i), IntegerEntry("amountForOwner", h), IntegerEntry("amount", b), StringEntry("assetid", c), StringEntry("nftid", d), StringEntry("creatorAddr", e), StringEntry("saleOwner", f), StringEntry("caller", g), StringEntry("creatorAddr", e), StringEntry("saleOwner", f), StringEntry("caller", g), ScriptTransfer(k, h, unit)]
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)))]
1159 }
1260
1361

github/deemru/w8io/026f985 
25.35 ms