tx · Vja8KeavLZvHAwp5ZcxanT4xx7P7Z9va937yhkmXNo5

3NCz3oCc3PNdauKDJEiPLzQwpBXXYEBc9p2:  -0.00200000 Waves

2022.08.02 16:21 [2166919] smart account 3NCz3oCc3PNdauKDJEiPLzQwpBXXYEBc9p2 > SELF 0.00000000 Waves

{ "type": 13, "id": "Vja8KeavLZvHAwp5ZcxanT4xx7P7Z9va937yhkmXNo5", "fee": 200000, "feeAssetId": null, "timestamp": 1659446548577, "version": 2, "chainId": 84, "sender": "3NCz3oCc3PNdauKDJEiPLzQwpBXXYEBc9p2", "senderPublicKey": "3rvQsNbK5fc274oTJXxit5LUfVpNUHyPrKiaJZbmJ7zx", "proofs": [ "2rgY7rKx2eBoFmbT9LTqo9BXCjCSL49LptV4raNjRdLhaWBN79h7HGpUqDgL8Rp55iJSuSVT9Y3E8gvdQrQbniTQ" ], "script": "base64:BgIRCAISBgoECAgICBIDCgEIEgAOAAdrQ29tbW9uAgZjb21tb24ABWtSYXJlAgRyYXJlAAprTGVnZW5kYXJ5AglsZWdlbmRhcnkABmtQcmljZQIKcHJpY2VMZXZlcgAJc2VwYXJhdG9yAgF8AAdrQWN0aXZlAgZhY3RpdmUABmFjdGl2ZQkBEUBleHRyTmF0aXZlKDEwNTEpAgUEdGhpcwUHa0FjdGl2ZQAJY291bnRSYXJlCQBkAgABCQELdmFsdWVPckVsc2UCCQCaCAIFBHRoaXMFBWtSYXJlAAAAC2NvdW50Q29tbW9uCQBkAgABCQELdmFsdWVPckVsc2UCCQCaCAIFBHRoaXMFB2tDb21tb24AAAAOY291bnRMZWdlbmRhcnkJAGQCAAEJAQt2YWx1ZU9yRWxzZQIJAJoIAgUEdGhpcwUKa0xlZ2VuZGFyeQAAAQhpc0FjdGl2ZQADBQZhY3RpdmUFBHVuaXQJAAIBAg9TdG9yZSBpcyBhY3RpdmUBCXJhbmRvbWl6ZQIFYnl0ZXMFcmFuZ2UEBGhhc2gJAPcDAQUFYnl0ZXMEBWluZGV4CQCxC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AQIMUGF5IGluIHdhdmVzBAxjb3JyZWN0UHJpY2UJARFAZXh0ck5hdGl2ZSgxMDUwKQIFBHRoaXMFBmtQcmljZQMJAGYCBQxjb3JyZWN0UHJpY2UFBmFtb3VudAkAAgECFlBheW1lbnQgYW1vdW50IDwgcHJpY2UEBnJhcml0eQkBEWNhbGN1bGF0aW9uUmFyaXR5AQgFAWkNdHJhbnNhY3Rpb25JZAQKc3RydWN0UmFyZQkBCmV4dHJhQ291bnQBBQZyYXJpdHkJAMwIAgUKc3RydWN0UmFyZQkAzAgCCQEOU2NyaXB0VHJhbnNmZXIDCAUBaQZjYWxsZXIAAQkA2QQBCQERQGV4dHJOYXRpdmUoMTA1MykCBQR0aGlzCQCsAgIJAKwCAgUGcmFyaXR5BQlzZXBhcmF0b3IJAKQDAQkBEUBleHRyTmF0aXZlKDEwNTApAgUEdGhpcwUGcmFyaXR5BQNuaWwAfNP9gQ==", "height": 2166919, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 676bakyFA99q3eahNLFUsBr24aKyg4e6C1PCtzGj86h2 Next: 4XQo9vUurvxsoaFXLMJE2bnnHDJCTf2J6Jago5N4M3wa Full:
OldNewDifferences
11 {-# STDLIB_VERSION 6 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
4-let a = "priceLever"
4+let a = "common"
55
6-let b = "|"
6+let b = "rare"
77
8-let c = "active"
8+let c = "legendary"
99
10-func d (e,f) = {
11- let g = sha256(e)
12- let h = toInt(g)
13- (h % f)
10+let d = "priceLever"
11+
12+let e = "|"
13+
14+let f = "active"
15+
16+let g = getBooleanValue(this, f)
17+
18+let h = (1 + valueOrElse(getInteger(this, b), 0))
19+
20+let i = (1 + valueOrElse(getInteger(this, a), 0))
21+
22+let j = (1 + valueOrElse(getInteger(this, c), 0))
23+
24+func k () = if (g)
25+ then unit
26+ else throw("Store is active")
27+
28+
29+func l (m,n) = {
30+ let o = sha256(m)
31+ let p = toInt(o)
32+ (p % n)
1433 }
1534
1635
17-func i (j) = {
18- let k = d(j, 100)
19- let l = d(j, 3)
20- let m = "common"
21- let n = "rare"
22- let o = "legendary"
23- if ((5 >= k))
24- then ((o + b) + toString(l))
25- else if ((k >= 80))
26- then ((n + b) + toString(l))
27- else ((m + b) + toString(l))
36+func q (r) = if ((r == a))
37+ then IntegerEntry(a, i)
38+ else if ((r == b))
39+ then IntegerEntry(b, i)
40+ else IntegerEntry(c, j)
41+
42+
43+func s (t) = {
44+ let u = l(t, 100)
45+ if ((5 >= u))
46+ then c
47+ else if ((u >= 80))
48+ then b
49+ else a
2850 }
2951
3052
31-@Callable(p)
32-func issueNft (q,r,s,t) = if ((p.caller != this))
53+@Callable(v)
54+func issueNft (w,x,y,z) = if ((v.caller != this))
3355 then throw("Only owner")
3456 else {
35- let u = Issue(q, r, 1, 0, false)
36- let v = calculateAssetId(u)
37-[StringEntry(((s + b) + t), toBase58String(v)), u]
57+ let A = Issue(w, x, 1, 0, false)
58+ let B = calculateAssetId(A)
59+[A, ScriptTransfer(v.caller, A.quantity, B)]
3860 }
3961
4062
4163
42-@Callable(p)
43-func setPrice (w) = if ((p.caller != this))
64+@Callable(v)
65+func setPrice (C) = if ((v.caller != this))
4466 then throw("Only owner")
45- else [StringEntry(a, w)]
67+ else [StringEntry(d, C)]
4668
4769
4870
49-@Callable(p)
50-func pullTheLever () = {
51- let s = i(p.transactionId)
52-[ScriptTransfer(p.caller, 1, fromBase58String(getStringValue(this, s)))]
53- }
71+@Callable(v)
72+func pullTheLever () = if (!(g))
73+ then throw("Not activated")
74+ else {
75+ let D = value(v.payments[0].amount)
76+ if ((v.payments[0].assetId != unit))
77+ then throw("Pay in waves")
78+ else {
79+ let E = getIntegerValue(this, d)
80+ if ((E > D))
81+ then throw("Payment amount < price")
82+ else {
83+ let y = s(v.transactionId)
84+ let F = q(y)
85+[F, ScriptTransfer(v.caller, 1, fromBase58String(getStringValue(this, ((y + e) + toString(getIntegerValue(this, y))))))]
86+ }
87+ }
88+ }
5489
5590

github/deemru/w8io/026f985 
32.20 ms