tx · AwyeGhAnjwWEQSCm4p4Gw7pyY8cDc3XMXjq5WL8dGQcQ

3N72SETEKtTuaA3YNVYWgVEmXKrRrZYXHGo:  -0.01000000 Waves

2022.11.16 16:04 [2319709] smart account 3N72SETEKtTuaA3YNVYWgVEmXKrRrZYXHGo > SELF 0.00000000 Waves

{ "type": 13, "id": "AwyeGhAnjwWEQSCm4p4Gw7pyY8cDc3XMXjq5WL8dGQcQ", "fee": 1000000, "feeAssetId": null, "timestamp": 1668603627353, "version": 2, "chainId": 84, "sender": "3N72SETEKtTuaA3YNVYWgVEmXKrRrZYXHGo", "senderPublicKey": "Kwu4LYBMntApXv8t7csxV23Kvc3tvak26wMKK56tA4V", "proofs": [ "2ZzXBeagaB8FBwBJr2caZEDKsFN3oHhvL1iqt48usQSWNa8KyiYMcGjGZV88xVhvykbnXZuqmTobKL62WVWjARsp" ], "script": "base64:BgIJCAISBQoDCAgBAAEBaQEGYnV5bmZ0Awdhc3NldElkBW5mdGlkDmFtb3VudEZvck93bmVyBAxvd25lckFkZHJlc3MIBQFpBmNhbGxlcgQFQWxpY2UJAQdBZGRyZXNzAQEaAVTHo8yFhBTYoCd/FEOkQ7UGFdEF3EX4ZyAJAMwIAgkBDEludGVnZXJFbnRyeQICDmFtb3VudEZvck93bmVyBQ5hbW91bnRGb3JPd25lcgkAzAgCCQELU3RyaW5nRW50cnkCAgdhc3NldGlkBQdhc3NldElkCQDMCAIJAQtTdHJpbmdFbnRyeQICBW5mdGlkBQVuZnRpZAkAzAgCCQEOU2NyaXB0VHJhbnNmZXIDBQVBbGljZQUOYW1vdW50Rm9yT3duZXIFBHVuaXQFA25pbAB1HRnY", "height": 2319709, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: FwyuTxCZkfQhSQsY4NBzVjtYMNv3TDStTam7PUP5Sqnp Next: GBHk4J5vx7ssRWeq413B7qWtU9roSorWQadmsVRM1jhM 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- }
254
265
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)))]
6+@Callable(a)
7+func buynft (b,c,d) = {
8+ let e = a.caller
9+ let f = Address(base58'3N87gU3S3GtPPo5S7dzRehArERGGJh1jwFD')
10+[IntegerEntry("amountForOwner", d), StringEntry("assetid", b), StringEntry("nftid", c), ScriptTransfer(f, d, unit)]
5911 }
6012
6113

github/deemru/w8io/026f985 
22.14 ms