tx · 9rriWfiy6jC4FbpEXCPhYR1qwL1ZU48KagRHnJAcNt3v

3MvoQ3q8wFnquWFPSZuBGunTnE1fphumBxd:  -0.01400000 Waves

2019.08.11 12:13 [626187] smart account 3MvoQ3q8wFnquWFPSZuBGunTnE1fphumBxd > SELF 0.00000000 Waves

{ "type": 13, "id": "9rriWfiy6jC4FbpEXCPhYR1qwL1ZU48KagRHnJAcNt3v", "fee": 1400000, "feeAssetId": null, "timestamp": 1565514839298, "version": 1, "sender": "3MvoQ3q8wFnquWFPSZuBGunTnE1fphumBxd", "senderPublicKey": "D7SkqDbPr1pTQ9McD2XsJyvNqjRakMoWERXwKVzCGTWj", "proofs": [ "3YpmnNLXKLXLCfaAgULtvsLqMxfw8DE5gkpsJzHdUTzV4NSSBToqLdwfQMCmTmT2NQwZTTMvC4jj1wMkd3H7cMpz" ], "script": "base64:AAIDAAAAAAAAAAAAAAAEAAAAABJtYXhBdWN0aW9uRHVyYXRpb24JAABoAAAAAgAAAAAAAAAFoAAAAAAAAAAAHgAAAAAOcmV2ZWFsRHVyYXRpb24JAABoAAAAAgAAAAAAAAAFoAAAAAAAAAAABwEAAAAKaGFzaFN0cmluZwAAAAEAAAAEZGF0YQQAAAAGcmVzdWx0CQACWgAAAAEJAAH3AAAAAQkAAZsAAAABBQAAAARkYXRhBQAAAAZyZXN1bHQBAAAACWFkZFRvTGlzdAAAAAIAAAAEbGlzdAAAAAl3aGF0VG9BZGQEAAAABnJlc3VsdAkAASwAAAACCQABLAAAAAIFAAAABGxpc3QCAAAAASAFAAAACXdoYXRUb0FkZAUAAAAGcmVzdWx0AAAAAwAAAAFpAQAAAAxzdGFydEF1Y3Rpb24AAAAEAAAACGR1cmF0aW9uAAAACnN0YXJ0UHJpY2UAAAAMcHJpY2VBc3NldElkAAAAB2RlcG9zaXQEAAAACWF1Y3Rpb25JZAkAAlgAAAABCAUAAAABaQAAAA10cmFuc2FjdGlvbklkBAAAAAtyZXZlYWxTdGFydAkAAGQAAAACCAUA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View: original | compacted Prev: 4unf2wmt2kcB1T7363gQ9if5Nf6juhSYoqJ8dxdeuzDM Next: GgJm87udZbki3YUS6mHQDpgDC1TNMtornQ7PtDAH84US Diff:
OldNewDifferences
1111 }
1212
1313
14-@Callable(f)
15-func startAuction (g,h,i,j) = {
16- let k = toBase58String(f.transactionId)
17- let l = (lastBlock.height + g)
18- let m = (l + b)
19- let n = extract(f.payment)
20- if ((g > a))
14+func f (g,h) = {
15+ let e = ((g + " ") + h)
16+ e
17+ }
18+
19+
20+@Callable(i)
21+func startAuction (j,k,l,m) = {
22+ let n = toBase58String(i.transactionId)
23+ let o = (lastBlock.height + j)
24+ let p = (o + b)
25+ let q = toBase58String(i.caller.bytes)
26+ let r = (q + "_organizer")
27+ let s = getString(this, r)
28+ let t = if (isDefined(s))
29+ then value(s)
30+ else ""
31+ let u = f(t, q)
32+ let v = extract(i.payment)
33+ if ((j > a))
2134 then throw(("Duration is too long. Must be less than " + toString(a)))
22- else if (!(isDefined(n.assetId)))
35+ else if (!(isDefined(v.assetId)))
2336 then throw("Payment currency should not be in WAVES")
24- else if ((n.amount != 1))
37+ else if ((v.amount != 1))
2538 then throw("Payment amount should be only one NFT")
26- else if ((0 >= h))
39+ else if ((0 >= k))
2740 then throw("Start price should be > 0")
28- else if ((h >= j))
29- then throw((("Start price should be < deposit (" + toString(j)) + ")"))
30- else if ((0 >= g))
41+ else if ((k >= m))
42+ then throw((("Start price should be < deposit (" + toString(m)) + ")"))
43+ else if ((0 >= j))
3144 then throw("Duration should be > 0")
32- else WriteSet([DataEntry((k + "_reveal_start"), l), DataEntry((k + "_deposit"), j), DataEntry((k + "_unrevealed_count"), 0), DataEntry((k + "_top_price"), 0), DataEntry((k + "_second_price"), 0), DataEntry((k + "_settle"), false), DataEntry((k + "_closing_start"), m), DataEntry((k + "_organizer"), toBase58String(f.caller.bytes)), DataEntry((k + "_lot_assetId"), if (isDefined(n.assetId))
33- then toBase58String(value(n.assetId))
34- else "WAVES"), DataEntry((k + "_lot_amount"), n.amount), DataEntry((k + "_startPrice"), h), DataEntry((k + "_priceAssetId"), i)])
45+ else WriteSet([DataEntry((n + "_reveal_start"), o), DataEntry((n + "_deposit"), m), DataEntry((n + "_unrevealed_count"), 0), DataEntry((n + "_top_price"), 0), DataEntry((n + "_second_price"), 0), DataEntry((n + "_settle"), false), DataEntry((n + "_closing_start"), p), DataEntry((n + "_organizer"), q), DataEntry((n + "_lot_assetId"), if (isDefined(v.assetId))
46+ then toBase58String(value(v.assetId))
47+ else "WAVES"), DataEntry((n + "_lot_amount"), v.amount), DataEntry((n + "_startPrice"), k), DataEntry((n + "_priceAssetId"), l), DataEntry(r, t)])
3548 }
3649
3750
3851
39-@Callable(f)
40-func bid (k,o) = {
41- let n = extract(f.payment)
42- let p = if (isDefined(n.assetId))
43- then toBase58String(value(n.assetId))
52+@Callable(i)
53+func bid (n,w) = {
54+ let v = extract(i.payment)
55+ let x = if (isDefined(v.assetId))
56+ then toBase58String(value(v.assetId))
4457 else "WAVES"
45- let q = toBase58String(f.caller.bytes)
46- let r = getIntegerValue(this, k)
47- let h = getIntegerValue(this, (k + "_startPrice"))
48- let i = getStringValue(this, (k + "_priceAssetId"))
49- let s = getStringValue(this, (k + "_organizer"))
50- let j = getIntegerValue(this, (k + "_deposit"))
51- let t = getIntegerValue(this, (k + "_unrevealed_count"))
52- let u = getString(this, (q + "_bidder"))
53- let v = isDefined(getString(this, ((k + q) + "bid_hash")))
54- if ((lastBlock.height >= r))
58+ let y = toBase58String(i.caller.bytes)
59+ let z = getIntegerValue(this, n)
60+ let k = getIntegerValue(this, (n + "_startPrice"))
61+ let l = getStringValue(this, (n + "_priceAssetId"))
62+ let q = getStringValue(this, (n + "_organizer"))
63+ let m = getIntegerValue(this, (n + "_deposit"))
64+ let A = getIntegerValue(this, (n + "_unrevealed_count"))
65+ let B = getString(this, (y + "_bidder"))
66+ let C = isDefined(getString(this, ((n + y) + "bid_hash")))
67+ if ((lastBlock.height >= z))
5568 then throw("Auction already finished")
56- else if (if (!(v))
57- then (i != p)
69+ else if (if (!(C))
70+ then (l != x)
5871 else false)
59- then throw((("Bid must be in asset '" + i) + "'"))
60- else if (!(isDefined(s)))
72+ then throw((("Bid must be in asset '" + l) + "'"))
73+ else if (!(isDefined(q)))
6174 then throw("Organizer should be defined")
62- else if (if (!(v))
63- then (n.amount != j)
75+ else if (if (!(C))
76+ then (v.amount != m)
6477 else false)
6578 then throw("Payment should be equel to deposit")
6679 else {
67- let w = if (v)
80+ let D = if (C)
6881 then 0
6982 else 1
70- WriteSet([DataEntry(((k + q) + "_revealed"), false), DataEntry(((k + q) + "_bid_hash"), o), DataEntry(((k + q) + "_settle"), false), DataEntry((k + "_unrevealed_cont"), (t + w)), DataEntry((q + "_bidder"), (((if (isDefined(u))
71- then value(u)
72- else "") + " ") + k))])
83+ WriteSet([DataEntry(((n + y) + "_revealed"), false), DataEntry(((n + y) + "_bid_hash"), w), DataEntry(((n + y) + "_settle"), false), DataEntry((n + "_unrevealed_cont"), (A + D)), DataEntry((y + "_bidder"), (((if (isDefined(B))
84+ then value(B)
85+ else "") + " ") + n))])
7386 }
7487 }
7588
7689
7790
78-@Callable(f)
79-func reveal (k,x,y) = {
80- let q = toBase58String(f.caller.bytes)
81- let s = getStringValue(this, (k + "_organizer"))
82- let z = getStringValue(this, (q + "_bid_hash"))
83- let A = getBooleanValue(this, (q + "_revealed"))
84- let l = getIntegerValue(this, (k + "_reveal_start"))
85- let m = getIntegerValue(this, (k + "_closing_start"))
86- let B = getIntegerValue(this, (k + "_top_price"))
87- let C = getIntegerValue(this, (k + "_second_price"))
88- let D = getStringValue(this, (k + "_winner"))
89- if (!(isDefined(s)))
91+@Callable(i)
92+func reveal (n,E,F) = {
93+ let y = toBase58String(i.caller.bytes)
94+ let q = getStringValue(this, (n + "_organizer"))
95+ let G = getStringValue(this, (y + "_bid_hash"))
96+ let H = getBooleanValue(this, (y + "_revealed"))
97+ let o = getIntegerValue(this, (n + "_reveal_start"))
98+ let p = getIntegerValue(this, (n + "_closing_start"))
99+ let I = getIntegerValue(this, (n + "_top_price"))
100+ let J = getIntegerValue(this, (n + "_second_price"))
101+ let K = getStringValue(this, (n + "_winner"))
102+ if (!(isDefined(q)))
90103 then throw("Organizer is not defined")
91- else if (!(isDefined(z)))
104+ else if (!(isDefined(G)))
92105 then throw("Bid is not defined")
93- else if (if ((l > lastBlock.height))
106+ else if (if ((o > lastBlock.height))
94107 then true
95- else (lastBlock.height > m))
108+ else (lastBlock.height > p))
96109 then throw("Auction should be revealed between reveal and closing times")
97- else if (if (isDefined(extract(f.payment)))
98- then (extract(f.payment).amount > 0)
110+ else if (if (isDefined(extract(i.payment)))
111+ then (extract(i.payment).amount > 0)
99112 else false)
100113 then throw("Payment shoud not exist")
101- else if ((c((y + toString(x))) != z))
114+ else if ((c((F + toString(E))) != G))
102115 then throw("Bid hash from bidMount and sault is not equel with hash from the caller bid")
103- else if ((A == true))
116+ else if ((H == true))
104117 then throw("The bid has been already revealed")
105118 else {
106- let E = if ((x > B))
107- then value(x)
108- else value(B)
109- let F = if ((x > B))
110- then value(B)
111- else if ((x > C))
112- then x
113- else C
114- let G = if ((x > B))
115- then q
116- else D
117- WriteSet([DataEntry((k + "_top_price"), E), DataEntry((k + "_second_price"), F), DataEntry((k + "_winner"), G), DataEntry((k + "_revealed"), false)])
119+ let L = if ((E > I))
120+ then value(E)
121+ else value(I)
122+ let M = if ((E > I))
123+ then value(I)
124+ else if ((E > J))
125+ then E
126+ else J
127+ let N = if ((E > I))
128+ then y
129+ else K
130+ WriteSet([DataEntry((n + "_top_price"), L), DataEntry((n + "_second_price"), M), DataEntry((n + "_winner"), N), DataEntry((n + "_revealed"), false)])
118131 }
119132 }
120133
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 3 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let a = (1440 * 30)
55
66 let b = (1440 * 7)
77
88 func c (d) = {
99 let e = toBase64String(sha256(toBytes(d)))
1010 e
1111 }
1212
1313
14-@Callable(f)
15-func startAuction (g,h,i,j) = {
16- let k = toBase58String(f.transactionId)
17- let l = (lastBlock.height + g)
18- let m = (l + b)
19- let n = extract(f.payment)
20- if ((g > a))
14+func f (g,h) = {
15+ let e = ((g + " ") + h)
16+ e
17+ }
18+
19+
20+@Callable(i)
21+func startAuction (j,k,l,m) = {
22+ let n = toBase58String(i.transactionId)
23+ let o = (lastBlock.height + j)
24+ let p = (o + b)
25+ let q = toBase58String(i.caller.bytes)
26+ let r = (q + "_organizer")
27+ let s = getString(this, r)
28+ let t = if (isDefined(s))
29+ then value(s)
30+ else ""
31+ let u = f(t, q)
32+ let v = extract(i.payment)
33+ if ((j > a))
2134 then throw(("Duration is too long. Must be less than " + toString(a)))
22- else if (!(isDefined(n.assetId)))
35+ else if (!(isDefined(v.assetId)))
2336 then throw("Payment currency should not be in WAVES")
24- else if ((n.amount != 1))
37+ else if ((v.amount != 1))
2538 then throw("Payment amount should be only one NFT")
26- else if ((0 >= h))
39+ else if ((0 >= k))
2740 then throw("Start price should be > 0")
28- else if ((h >= j))
29- then throw((("Start price should be < deposit (" + toString(j)) + ")"))
30- else if ((0 >= g))
41+ else if ((k >= m))
42+ then throw((("Start price should be < deposit (" + toString(m)) + ")"))
43+ else if ((0 >= j))
3144 then throw("Duration should be > 0")
32- else WriteSet([DataEntry((k + "_reveal_start"), l), DataEntry((k + "_deposit"), j), DataEntry((k + "_unrevealed_count"), 0), DataEntry((k + "_top_price"), 0), DataEntry((k + "_second_price"), 0), DataEntry((k + "_settle"), false), DataEntry((k + "_closing_start"), m), DataEntry((k + "_organizer"), toBase58String(f.caller.bytes)), DataEntry((k + "_lot_assetId"), if (isDefined(n.assetId))
33- then toBase58String(value(n.assetId))
34- else "WAVES"), DataEntry((k + "_lot_amount"), n.amount), DataEntry((k + "_startPrice"), h), DataEntry((k + "_priceAssetId"), i)])
45+ else WriteSet([DataEntry((n + "_reveal_start"), o), DataEntry((n + "_deposit"), m), DataEntry((n + "_unrevealed_count"), 0), DataEntry((n + "_top_price"), 0), DataEntry((n + "_second_price"), 0), DataEntry((n + "_settle"), false), DataEntry((n + "_closing_start"), p), DataEntry((n + "_organizer"), q), DataEntry((n + "_lot_assetId"), if (isDefined(v.assetId))
46+ then toBase58String(value(v.assetId))
47+ else "WAVES"), DataEntry((n + "_lot_amount"), v.amount), DataEntry((n + "_startPrice"), k), DataEntry((n + "_priceAssetId"), l), DataEntry(r, t)])
3548 }
3649
3750
3851
39-@Callable(f)
40-func bid (k,o) = {
41- let n = extract(f.payment)
42- let p = if (isDefined(n.assetId))
43- then toBase58String(value(n.assetId))
52+@Callable(i)
53+func bid (n,w) = {
54+ let v = extract(i.payment)
55+ let x = if (isDefined(v.assetId))
56+ then toBase58String(value(v.assetId))
4457 else "WAVES"
45- let q = toBase58String(f.caller.bytes)
46- let r = getIntegerValue(this, k)
47- let h = getIntegerValue(this, (k + "_startPrice"))
48- let i = getStringValue(this, (k + "_priceAssetId"))
49- let s = getStringValue(this, (k + "_organizer"))
50- let j = getIntegerValue(this, (k + "_deposit"))
51- let t = getIntegerValue(this, (k + "_unrevealed_count"))
52- let u = getString(this, (q + "_bidder"))
53- let v = isDefined(getString(this, ((k + q) + "bid_hash")))
54- if ((lastBlock.height >= r))
58+ let y = toBase58String(i.caller.bytes)
59+ let z = getIntegerValue(this, n)
60+ let k = getIntegerValue(this, (n + "_startPrice"))
61+ let l = getStringValue(this, (n + "_priceAssetId"))
62+ let q = getStringValue(this, (n + "_organizer"))
63+ let m = getIntegerValue(this, (n + "_deposit"))
64+ let A = getIntegerValue(this, (n + "_unrevealed_count"))
65+ let B = getString(this, (y + "_bidder"))
66+ let C = isDefined(getString(this, ((n + y) + "bid_hash")))
67+ if ((lastBlock.height >= z))
5568 then throw("Auction already finished")
56- else if (if (!(v))
57- then (i != p)
69+ else if (if (!(C))
70+ then (l != x)
5871 else false)
59- then throw((("Bid must be in asset '" + i) + "'"))
60- else if (!(isDefined(s)))
72+ then throw((("Bid must be in asset '" + l) + "'"))
73+ else if (!(isDefined(q)))
6174 then throw("Organizer should be defined")
62- else if (if (!(v))
63- then (n.amount != j)
75+ else if (if (!(C))
76+ then (v.amount != m)
6477 else false)
6578 then throw("Payment should be equel to deposit")
6679 else {
67- let w = if (v)
80+ let D = if (C)
6881 then 0
6982 else 1
70- WriteSet([DataEntry(((k + q) + "_revealed"), false), DataEntry(((k + q) + "_bid_hash"), o), DataEntry(((k + q) + "_settle"), false), DataEntry((k + "_unrevealed_cont"), (t + w)), DataEntry((q + "_bidder"), (((if (isDefined(u))
71- then value(u)
72- else "") + " ") + k))])
83+ WriteSet([DataEntry(((n + y) + "_revealed"), false), DataEntry(((n + y) + "_bid_hash"), w), DataEntry(((n + y) + "_settle"), false), DataEntry((n + "_unrevealed_cont"), (A + D)), DataEntry((y + "_bidder"), (((if (isDefined(B))
84+ then value(B)
85+ else "") + " ") + n))])
7386 }
7487 }
7588
7689
7790
78-@Callable(f)
79-func reveal (k,x,y) = {
80- let q = toBase58String(f.caller.bytes)
81- let s = getStringValue(this, (k + "_organizer"))
82- let z = getStringValue(this, (q + "_bid_hash"))
83- let A = getBooleanValue(this, (q + "_revealed"))
84- let l = getIntegerValue(this, (k + "_reveal_start"))
85- let m = getIntegerValue(this, (k + "_closing_start"))
86- let B = getIntegerValue(this, (k + "_top_price"))
87- let C = getIntegerValue(this, (k + "_second_price"))
88- let D = getStringValue(this, (k + "_winner"))
89- if (!(isDefined(s)))
91+@Callable(i)
92+func reveal (n,E,F) = {
93+ let y = toBase58String(i.caller.bytes)
94+ let q = getStringValue(this, (n + "_organizer"))
95+ let G = getStringValue(this, (y + "_bid_hash"))
96+ let H = getBooleanValue(this, (y + "_revealed"))
97+ let o = getIntegerValue(this, (n + "_reveal_start"))
98+ let p = getIntegerValue(this, (n + "_closing_start"))
99+ let I = getIntegerValue(this, (n + "_top_price"))
100+ let J = getIntegerValue(this, (n + "_second_price"))
101+ let K = getStringValue(this, (n + "_winner"))
102+ if (!(isDefined(q)))
90103 then throw("Organizer is not defined")
91- else if (!(isDefined(z)))
104+ else if (!(isDefined(G)))
92105 then throw("Bid is not defined")
93- else if (if ((l > lastBlock.height))
106+ else if (if ((o > lastBlock.height))
94107 then true
95- else (lastBlock.height > m))
108+ else (lastBlock.height > p))
96109 then throw("Auction should be revealed between reveal and closing times")
97- else if (if (isDefined(extract(f.payment)))
98- then (extract(f.payment).amount > 0)
110+ else if (if (isDefined(extract(i.payment)))
111+ then (extract(i.payment).amount > 0)
99112 else false)
100113 then throw("Payment shoud not exist")
101- else if ((c((y + toString(x))) != z))
114+ else if ((c((F + toString(E))) != G))
102115 then throw("Bid hash from bidMount and sault is not equel with hash from the caller bid")
103- else if ((A == true))
116+ else if ((H == true))
104117 then throw("The bid has been already revealed")
105118 else {
106- let E = if ((x > B))
107- then value(x)
108- else value(B)
109- let F = if ((x > B))
110- then value(B)
111- else if ((x > C))
112- then x
113- else C
114- let G = if ((x > B))
115- then q
116- else D
117- WriteSet([DataEntry((k + "_top_price"), E), DataEntry((k + "_second_price"), F), DataEntry((k + "_winner"), G), DataEntry((k + "_revealed"), false)])
119+ let L = if ((E > I))
120+ then value(E)
121+ else value(I)
122+ let M = if ((E > I))
123+ then value(I)
124+ else if ((E > J))
125+ then E
126+ else J
127+ let N = if ((E > I))
128+ then y
129+ else K
130+ WriteSet([DataEntry((n + "_top_price"), L), DataEntry((n + "_second_price"), M), DataEntry((n + "_winner"), N), DataEntry((n + "_revealed"), false)])
118131 }
119132 }
120133
121134

github/deemru/w8io/026f985 
97.58 ms