tx · HpyAvKCkFMgzDDJE257AYtxvKtTpaMF3rSarwr9tcjGT

3N8gbU8daeQsLjaMgBngnZB999X7e13Rk4A:  -0.01400000 Waves

2021.04.12 18:50 [1479438] smart account 3N8gbU8daeQsLjaMgBngnZB999X7e13Rk4A > SELF 0.00000000 Waves

{ "type": 13, "id": "HpyAvKCkFMgzDDJE257AYtxvKtTpaMF3rSarwr9tcjGT", "fee": 1400000, "feeAssetId": null, "timestamp": 1618242640183, "version": 2, "chainId": 84, "sender": "3N8gbU8daeQsLjaMgBngnZB999X7e13Rk4A", "senderPublicKey": "Bo8DbABLbLDy5spqq8CTn9AWWjnwuyWYDyfVoSoUGJfL", "proofs": [ "33Yz9orjkwCik55MjNM62GjvWDZ5MtEbRf1jcszpzPpMfFwSjrAkVtXNeDVLrnfn4biKZ2bA6c6thCM2rUofz2zr" ], "script": "base64:AAIEAAAAAAAAAB4IAhIGCgQICAgBEgMKAQgSBgoECAgICBIFCgMICAgAAAAAAAAABAAAAAFpAQAAAApkZXBvc2l0TmZ0AAAABAAAAAVuZnRJZAAAABByZWNpcGllbnRBZGRyZXNzAAAAB3ByaWNlSWQAAAALcHJpY2VBbW91bnQEAAAAA3BtdAkAAZEAAAACCAUAAAABaQAAAAhwYXltZW50cwAAAAAAAAAAAAQAAAAJcG10QW1vdW50CAUAAAADcG10AAAABmFtb3VudAQAAAAJY3VycmVudElkCQACWAAAAAEJAQAAAAV2YWx1ZQAAAAEIBQAAAANwbXQAAAAHYXNzZXRJZAQAAAANc2VuZGVyQWRkcmVzcwkAAlgAAAABCAgFAAAAAWkAAAAGY2FsbGVyAAAABWJ5dGVzAwkBAAAAAiE9AAAAAgUAAAAFbmZ0SWQFAAAACWN1cnJlbnRJZAkAAAIAAAABAgAAABBjYW4gbm90IHRyYW5zZmVyCQAETAAAAAIJAQAAAAtTdHJpbmdFbnRyeQAAAAIJAAEsAAAAAgUAAAAJY3VycmVudElkAgAAAAdfc2VuZGVyBQAAAA1zZW5kZXJBZGRy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mdFbnRyeQAAAAIFAAAAC25mdElkU3RyaW5nBQAAAARqc29uCQAETAAAAAIJAQAAAA5TY3JpcHRUcmFuc2ZlcgAAAAMIBQAAAAFpAAAABmNhbGxlcgAAAAAAAAAAAQUAAAAFbmZ0SWQFAAAAA25pbAAAAAFpAQAAAAl1cGRhdGVOZnQAAAADAAAABGNvZGUAAAAFbmZ0aWQAAAAEanNvbgQAAAAFbmZ0SWQJAAJZAAAAAQUAAAAFbmZ0aWQEAAAAB2JhbGFuY2UJAAPwAAAAAggFAAAAAWkAAAAGY2FsbGVyBQAAAAVuZnRJZAMJAAAAAAAAAgUAAAAHYmFsYW5jZQAAAAAAAAAAAQkABEwAAAACCQEAAAALU3RyaW5nRW50cnkAAAACBQAAAAVuZnRpZAUAAAAEanNvbgUAAAADbmlsCQAAAgAAAAECAAAAIVlvdSBhcmUgbm90IGF1dGhvcml6ZWQgdG8gdXBkYXRlLgAAAAEAAAACdHgBAAAABnZlcmlmeQAAAAAJAAH0AAAAAwgFAAAAAnR4AAAACWJvZHlCeXRlcwkAAZEAAAACCAUAAAACdHgAAAAGcHJvb2ZzAAAAAAAAAAAACAUAAAACdHgAAAAPc2VuZGVyUHVibGljS2V5nWUEaA==", "height": 1479438, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: HsmusuhHUpnqfiKYnAVKGPYnQ2bv8QNa7KhpSfECrM9S Next: none Diff:
OldNewDifferences
44
55
66 @Callable(a)
7-func issueNft (b,c,d,e) = {
8- let f = Issue("GOLF GEAR NFT", ((c + " / ") + d), 1, 0, false)
9- let g = calculateAssetId(f)
10- let h = toBase58String(g)
11-[f, StringEntry(h, e), ScriptTransfer(a.caller, 1, g)]
7+func depositNft (b,c,d,e) = {
8+ let f = a.payments[0]
9+ let g = f.amount
10+ let h = toBase58String(value(f.assetId))
11+ let i = toBase58String(a.caller.bytes)
12+ if ((b != h))
13+ then throw("can not transfer")
14+ else [StringEntry((h + "_sender"), i), StringEntry((h + "_recipient"), c), StringEntry((h + "_priceId"), d), IntegerEntry((h + "_priceAmount"), e), IntegerEntry((h + "_nftAmount"), g)]
1215 }
1316
1417
1518
1619 @Callable(a)
17-func updateNft (b,i,e) = {
18- let g = fromBase58String(i)
19- let j = assetBalance(a.caller, g)
20- if ((j == 1))
21- then [StringEntry(i, e)]
20+func swapNft (j) = {
21+ let f = a.payments[0]
22+ let g = f.amount
23+ let b = fromBase58String(j)
24+ let d = toBase58String(value(f.assetId))
25+ let c = toBase58String(a.caller.bytes)
26+ let e = {
27+ let k = getInteger(this, (j + "_priceAmount"))
28+ if ($isInstanceOf(k, "Int"))
29+ then {
30+ let l = k
31+ l
32+ }
33+ else 0
34+ }
35+ let m = {
36+ let k = getString(this, (j + "_recipient"))
37+ if ($isInstanceOf(k, "String"))
38+ then {
39+ let l = k
40+ l
41+ }
42+ else 0
43+ }
44+ let n = {
45+ let k = getInteger(this, (j + "_nftAmount"))
46+ if ($isInstanceOf(k, "Int"))
47+ then {
48+ let l = k
49+ l
50+ }
51+ else 0
52+ }
53+ let o = (n - g)
54+ if ((e != g))
55+ then throw("")
56+ else if ((c != m))
57+ then throw("")
58+ else if ((o != 1))
59+ then throw("")
60+ else [IntegerEntry((j + "_nftAmount"), o), ScriptTransfer(a.caller, 1, b)]
61+ }
62+
63+
64+
65+@Callable(a)
66+func issueNft (p,q,r,s) = {
67+ let t = Issue("GOLF GEAR NFT", ((q + " / ") + r), 1, 0, false)
68+ let b = calculateAssetId(t)
69+ let u = toBase58String(b)
70+[t, StringEntry(u, s), ScriptTransfer(a.caller, 1, b)]
71+ }
72+
73+
74+
75+@Callable(a)
76+func updateNft (p,j,s) = {
77+ let b = fromBase58String(j)
78+ let v = assetBalance(a.caller, b)
79+ if ((v == 1))
80+ then [StringEntry(j, s)]
2281 else throw("You are not authorized to update.")
2382 }
2483
2584
26-@Verifier(k)
27-func l () = sigVerify(k.bodyBytes, k.proofs[0], k.senderPublicKey)
85+@Verifier(w)
86+func x () = sigVerify(w.bodyBytes, w.proofs[0], w.senderPublicKey)
2887
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 4 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44
55
66 @Callable(a)
7-func issueNft (b,c,d,e) = {
8- let f = Issue("GOLF GEAR NFT", ((c + " / ") + d), 1, 0, false)
9- let g = calculateAssetId(f)
10- let h = toBase58String(g)
11-[f, StringEntry(h, e), ScriptTransfer(a.caller, 1, g)]
7+func depositNft (b,c,d,e) = {
8+ let f = a.payments[0]
9+ let g = f.amount
10+ let h = toBase58String(value(f.assetId))
11+ let i = toBase58String(a.caller.bytes)
12+ if ((b != h))
13+ then throw("can not transfer")
14+ else [StringEntry((h + "_sender"), i), StringEntry((h + "_recipient"), c), StringEntry((h + "_priceId"), d), IntegerEntry((h + "_priceAmount"), e), IntegerEntry((h + "_nftAmount"), g)]
1215 }
1316
1417
1518
1619 @Callable(a)
17-func updateNft (b,i,e) = {
18- let g = fromBase58String(i)
19- let j = assetBalance(a.caller, g)
20- if ((j == 1))
21- then [StringEntry(i, e)]
20+func swapNft (j) = {
21+ let f = a.payments[0]
22+ let g = f.amount
23+ let b = fromBase58String(j)
24+ let d = toBase58String(value(f.assetId))
25+ let c = toBase58String(a.caller.bytes)
26+ let e = {
27+ let k = getInteger(this, (j + "_priceAmount"))
28+ if ($isInstanceOf(k, "Int"))
29+ then {
30+ let l = k
31+ l
32+ }
33+ else 0
34+ }
35+ let m = {
36+ let k = getString(this, (j + "_recipient"))
37+ if ($isInstanceOf(k, "String"))
38+ then {
39+ let l = k
40+ l
41+ }
42+ else 0
43+ }
44+ let n = {
45+ let k = getInteger(this, (j + "_nftAmount"))
46+ if ($isInstanceOf(k, "Int"))
47+ then {
48+ let l = k
49+ l
50+ }
51+ else 0
52+ }
53+ let o = (n - g)
54+ if ((e != g))
55+ then throw("")
56+ else if ((c != m))
57+ then throw("")
58+ else if ((o != 1))
59+ then throw("")
60+ else [IntegerEntry((j + "_nftAmount"), o), ScriptTransfer(a.caller, 1, b)]
61+ }
62+
63+
64+
65+@Callable(a)
66+func issueNft (p,q,r,s) = {
67+ let t = Issue("GOLF GEAR NFT", ((q + " / ") + r), 1, 0, false)
68+ let b = calculateAssetId(t)
69+ let u = toBase58String(b)
70+[t, StringEntry(u, s), ScriptTransfer(a.caller, 1, b)]
71+ }
72+
73+
74+
75+@Callable(a)
76+func updateNft (p,j,s) = {
77+ let b = fromBase58String(j)
78+ let v = assetBalance(a.caller, b)
79+ if ((v == 1))
80+ then [StringEntry(j, s)]
2281 else throw("You are not authorized to update.")
2382 }
2483
2584
26-@Verifier(k)
27-func l () = sigVerify(k.bodyBytes, k.proofs[0], k.senderPublicKey)
85+@Verifier(w)
86+func x () = sigVerify(w.bodyBytes, w.proofs[0], w.senderPublicKey)
2887

github/deemru/w8io/169f3d6 
59.78 ms