tx · DsMjkGrzCzAT6gPs1qEqLYfAQJccqP8TeLQQkR9eXAPv

3N4boZRUJ2LxY5jLyp6hmxGktqnawQidu6H:  -0.01000000 Waves

2022.11.04 15:25 [2302368] smart account 3N4boZRUJ2LxY5jLyp6hmxGktqnawQidu6H > SELF 0.00000000 Waves

{ "type": 13, "id": "DsMjkGrzCzAT6gPs1qEqLYfAQJccqP8TeLQQkR9eXAPv", "fee": 1000000, "feeAssetId": null, "timestamp": 1667564781055, "version": 2, "chainId": 84, "sender": "3N4boZRUJ2LxY5jLyp6hmxGktqnawQidu6H", "senderPublicKey": "BDeCphaaC4MZvfmbJqQZ78EvuEBZTJ1VEW7fbxue8BUu", "proofs": [ "3EoJwy7WTBht4wZ3rxmZPi5DvPpTcPUdV3TtFLDKBVVCrQnDXyymzceB44S8AWNhFsPbADjpW5Kii3uMFqexL4mY" ], "script": "base64:BgIRCAISABIFCgMCCAgSBAoCAggVAAlzZXBhcmF0b3ICAV8AC2tDb2xsZWN0aW9uAgpjb2xsZWN0aW9uAARrTmZ0AgNuZnQAEUNPTExFQ1RJT05TX0xJTUlUAPQDAAlORlRfTElNSVQA9AMBEGdldENvbGxlY3Rpb25LZXkBDGNvbGxlY3Rpb25JZAkAuQkCCQDMCAIFC2tDb2xsZWN0aW9uCQDMCAIJANgEAQUMY29sbGVjdGlvbklkBQNuaWwFCXNlcGFyYXRvcgESZ2V0Q29sbGVjdGlvblZhbHVlAgtjb2xsZWN0aW9ucwxjb2xsZWN0aW9uSWQJALkJAgkAzAgCBQtjb2xsZWN0aW9ucwkAzAgCCQDYBAEFDGNvbGxlY3Rpb25JZAUDbmlsBQlzZXBhcmF0b3IBCWdldE5mdEtleQEFbmZ0SWQJALkJAgkAzAgCBQRrTmZ0CQDMCAIJANgEAQUFbmZ0SWQFA25pbAUJc2VwYXJhdG9yAQtnZXROZnRWYWx1ZQIEbmZ0cwVuZnRJZAkAuQkCCQDMCAIFBG5mdHMJAMwIAgkA2AQBBQVuZnRJZAUD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9uSWQFA25pbAFpAQRtaW50Awxjb2xsZWN0aW9uSWQEbmFtZQRtZXRhAwkBASEBCQERaXNDb2xsZWN0aW9uRXhpc3QCCAUBaQZjYWxsZXIFDGNvbGxlY3Rpb25JZAkAAgECHVdyb25nIGNvbGxlY3Rpb24gb3IgY2FsbGVyIElEAwkBEmlzTmZ0c0xpbWl0UmVhY2hlZAEFDGNvbGxlY3Rpb25JZAkAAgECKVlvdSByZWFjaGVkIG5mdHMgbGltaXQgaW4gdGhpcyBjb2xsZWN0aW9uBAhuZXdUb2tlbgkAwggFBQRuYW1lBQRtZXRhAAEAAAcEB2lzc3VlSWQJALgIAQUIbmV3VG9rZW4JAMwIAgUIbmV3VG9rZW4JAMwIAgkBDlNjcmlwdFRyYW5zZmVyAwgFAWkGY2FsbGVyCAUIbmV3VG9rZW4IcXVhbnRpdHkFB2lzc3VlSWQJAMwIAgkBFXNldE5mdHNGcm9tQ29sbGVjdGlvbgMFDGNvbGxlY3Rpb25JZAkBHmdldE5mdHNGcm9tQ29sbGVjdGlvbkZvclVwZGF0ZQEFDGNvbGxlY3Rpb25JZAUHaXNzdWVJZAUDbmlsAWkBCnNldENvbnRlbnQCBW5mdElkB2NvbnRlbnQJAQt2YWx1ZU9yRWxzZQIJAQ9pc0NvcnJlY3RDYWxsZXICBQVuZnRJZAgFAWkGY2FsbGVyCQDMCAIJAQtTdHJpbmdFbnRyeQIJAQlnZXROZnRLZXkBBQVuZnRJZAUHY29udGVudAUDbmlsAPRmB6c=", "height": 2302368, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: JCppjZfE3119Zr8BcwDsr3p4uiAT2bjtfBgqdZd4cJdK Next: DsLcwqCtckvqSCfr4BeG9ntsTXWq4ZvTQDSTT18qcXJ5 Full:
OldNewDifferences
1-{-# STDLIB_VERSION 3 #-}
1+{-# STDLIB_VERSION 6 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
4-let a = (1440 * 30)
4+let a = "_"
55
6-@Callable(b)
7-func startAuction (c,d,e) = {
8- let f = toBase58String(b.transactionId)
9- let g = (lastBlock.height + c)
10- let h = extract(b.payment)
11- if ((c > a))
12- then throw(("Duration is too long. Must be less than " + toString(a)))
13- else WriteSet([DataEntry(f, g), DataEntry((f + "_organizer"), toBase58String(b.caller.bytes)), DataEntry((f + "_lot_assetId"), if (isDefined(h.assetId))
14- then toBase58String(value(h.assetId))
15- else "WAVES"), DataEntry((f + "_lot_amount"), h.amount), DataEntry((f + "_startPrice"), d), DataEntry((f + "_priceAssetId"), e)])
6+let b = "collection"
7+
8+let c = "nft"
9+
10+let d = 500
11+
12+let e = 500
13+
14+func f (g) = makeString([b, toBase58String(g)], a)
15+
16+
17+func h (i,g) = makeString([i, toBase58String(g)], a)
18+
19+
20+func j (k) = makeString([c, toBase58String(k)], a)
21+
22+
23+func l (m,k) = makeString([m, toBase58String(k)], a)
24+
25+
26+func n (o) = split(valueOrElse(getString(this, toString(o)), ""), a)
27+
28+
29+func p (g) = split(valueOrElse(getString(this, f(g)), ""), a)
30+
31+
32+func q (o) = valueOrElse(getString(this, toString(o)), "")
33+
34+
35+func r (g) = valueOrElse(getString(this, f(g)), "")
36+
37+
38+func s (o,i,g) = if ((i == ""))
39+ then StringEntry(toString(o), toBase58String(g))
40+ else StringEntry(toString(o), h(i, g))
41+
42+
43+func t (g,m,k) = if ((m == ""))
44+ then StringEntry(f(g), toBase58String(k))
45+ else StringEntry(f(g), l(m, k))
46+
47+
48+func u (v) = (size(n(v)) > d)
49+
50+
51+func w (g) = (size(p(g)) > e)
52+
53+
54+func x (k,v) = (assetBalance(v, k) == 1)
55+
56+
57+func y (k) = isDefined(getString(this, j(k)))
58+
59+
60+func z (o,g) = {
61+ let A = n(o)
62+ containsElement(A, toBase58String(g))
1663 }
1764
1865
66+func B (k,v) = if (!(x(k, v)))
67+ then throw("Caller is not owner of nft")
68+ else if (y(k))
69+ then throw("Content already setted for this nft")
70+ else unit
1971
20-@Callable(b)
21-func bid (f) = {
22- let h = extract(b.payment)
23- let i = if (isDefined(h.assetId))
24- then toBase58String(value(h.assetId))
25- else "WAVES"
26- let j = toBase58String(b.caller.bytes)
27- let g = getIntegerValue(this, f)
28- let d = getIntegerValue(this, (f + "_startPrice"))
29- let e = getStringValue(this, (f + "_priceAssetId"))
30- let k = getInteger(this, (f + "_winAmount"))
31- let l = getString(this, (f + "_winner"))
32- let m = if (isDefined(l))
33- then (value(l) == j)
34- else false
35- let n = (h.amount + (if (m)
36- then value(k)
37- else 0))
38- if ((lastBlock.height >= g))
39- then throw("Auction already finished")
40- else if ((e != i))
41- then throw((("Bid must be in asset '" + e) + "'"))
42- else if (if (if (isDefined(k))
43- then (value(k) >= n)
44- else false)
45- then true
46- else if (!(isDefined(k)))
47- then (d >= n)
48- else false)
49- then throw(("Bid must be more then " + toString(if (isDefined(k))
50- then value(k)
51- else d)))
52- else if (if (m)
53- then true
54- else !(isDefined(l)))
55- then WriteSet([DataEntry((f + "_winner"), j), DataEntry((f + "_winAmount"), n)])
56- else {
57- let o = addressFromStringValue(value(l))
58- let p = if (if ((e == "WAVES"))
59- then true
60- else (e == ""))
61- then unit
62- else fromBase58String(e)
63- ScriptResult(WriteSet([DataEntry((f + "_winner"), j), DataEntry((f + "_winAmount"), n)]), TransferSet([ScriptTransfer(o, value(k), p)]))
64- }
65- }
72+
73+@Callable(C)
74+func addCollection () = if (u(C.caller))
75+ then throw("You reached collections limit")
76+ else [s(C.caller, q(C.caller), C.transactionId)]
6677
6778
6879
69-@Callable(b)
70-func withdraw (f) = {
71- let h = extract(b.payment)
72- let i = if (isDefined(h.assetId))
73- then toBase58String(value(h.assetId))
74- else "WAVES"
75- let j = toBase58String(b.caller.bytes)
76- let g = getIntegerValue(this, f)
77- let q = getStringValue(this, (f + "_organizer"))
78- let l = getString(this, (f + "_winner"))
79- let r = getStringValue(this, (f + "_lot_assetId"))
80- let s = getIntegerValue(this, (f + "_lot_amount"))
81- let e = getStringValue(this, (f + "_priceAssetId"))
82- let k = getIntegerValue(this, (f + "_winAmount"))
83- let t = if ((r == "WAVES"))
84- then unit
85- else fromBase58String(r)
86- let p = if (if ((e == "WAVES"))
87- then true
88- else (e == ""))
89- then unit
90- else fromBase58String(e)
91- let u = addressFromStringValue(value(l))
92- let v = addressFromStringValue(value(q))
93- let w = getInteger(this, ((f + "_bidder_") + j))
94- if ((g > lastBlock.height))
95- then throw("Auction is not finished yet")
96- else if (!(isDefined(l)))
97- then if (isDefined(getString(this, (f + "_lot_passed"))))
98- then throw("Organizer has already got his lot back")
99- else ScriptResult(WriteSet([DataEntry((f + "_lot_passed"), q)]), TransferSet([ScriptTransfer(v, s, t)]))
100- else if (isDefined(getString(this, (f + "_lot_passed"))))
101- then throw("Lot is already passed to the winner, and organizer got his reward")
102- else ScriptResult(WriteSet([DataEntry((f + "_lot_passed"), toBase58String(u.bytes))]), TransferSet([ScriptTransfer(u, s, t), ScriptTransfer(v, k, p)]))
103- }
80+@Callable(C)
81+func mint (g,D,E) = if (!(z(C.caller, g)))
82+ then throw("Wrong collection or caller ID")
83+ else if (w(g))
84+ then throw("You reached nfts limit in this collection")
85+ else {
86+ let F = Issue(D, E, 1, 0, false)
87+ let G = calculateAssetId(F)
88+[F, ScriptTransfer(C.caller, F.quantity, G), t(g, r(g), G)]
89+ }
90+
91+
92+
93+@Callable(C)
94+func setContent (k,H) = valueOrElse(B(k, C.caller), [StringEntry(j(k), H)])
10495
10596

github/deemru/w8io/026f985 
27.40 ms