tx · 4XamF6khEMBHypq4b3rWsPUNDyhp5gT1wVJkmthEgqv9 3MxssetYXJfiGwzo9pqChsSwYj3tCYq5FFH: -0.00400000 Waves 2022.09.25 16:53 [2244753] smart account 3MxssetYXJfiGwzo9pqChsSwYj3tCYq5FFH > SELF 0.00000000 Waves
{ "type": 13, "id": "4XamF6khEMBHypq4b3rWsPUNDyhp5gT1wVJkmthEgqv9", "fee": 400000, "feeAssetId": null, "timestamp": 1664114035770, "version": 2, "chainId": 84, "sender": "3MxssetYXJfiGwzo9pqChsSwYj3tCYq5FFH", "senderPublicKey": "46sMMaC9rMPQdyTE87RpcnevTY9oheuDqzfnuQzoyCtv", "proofs": [ "4shpQQ8PLQe7QQrCwzyFLGnR4dmh6ha16xC4aLDZpNhtM5q1x5GD8yE7JBn9As2Uv7KjRU7KwfF3LRSbDjwNnHAk" ], "script": "base64:BgIYCAISBwoFAQEBAQESBAoCAQgSBQoDAQgBCgERZ2V0SW50ZWdlck9yVGhyb3cCB2FkZHJlc3MDa2V5CQETdmFsdWVPckVycm9yTWVzc2FnZQIJAJoIAgUHYWRkcmVzcwUDa2V5CQCsAgIJAKwCAgkArAICAgxDYW4ndCByZWFkICcFA2tleQINJyBhdCBhZGRyZXNzIAkApQgBBQdhZGRyZXNzARNnZXRJbnRlZ2VyT3JEZWZhdWx0AwdhZGRyZXNzA2tleQdkZWZhdWx0CQELdmFsdWVPckVsc2UCCQCaCAIFB2FkZHJlc3MFA2tleQUHZGVmYXVsdAERcGFyc2VJbnRPckRlZmF1bHQCCG1heWJlSW50B2RlZmF1bHQJAQt2YWx1ZU9yRWxzZQIJALYJAQUIbWF5YmVJbnQFB2RlZmF1bHQACGF1Y1N0YXJ0CQERZ2V0SW50ZWdlck9yVGhyb3cCBQR0aGlzAg5pbml0X3RpbWVzdGFtcAALYmlkRHVyYXRpb24JARFnZXRJbnRlZ2VyT3JUaHJvdwIFBHRoaXMCDGJpZF9kdXJhdGlvbgAOcmV2ZWFsRHVyYXRpb24J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YWx1ZQEJAJ0IAgUEdGhpcwkBBXZhbHVlAQUSdG9wQmlkZGVyUmV2ZWFsS2V5BAx0b3BCaWRBbW91bnQJAQ1wYXJzZUludFZhbHVlAQkAkQMCCQC1CQIFDXRvcEJpZGRlckRhdGECASwAAQMDCQBmAgUJYmlkQW1vdW50BQx0b3BCaWRBbW91bnQJAGcCBQdkZXBvc2l0BQliaWRBbW91bnQHCQDNCAIFCXJldmVhbEJpZAkBC1N0cmluZ0VudHJ5AgUGdG9wS2V5BQlyZXZlYWxLZXkFCXJldmVhbEJpZAkAzQgCBQlyZXZlYWxCaWQJAQtTdHJpbmdFbnRyeQIFBnRvcEtleQUJcmV2ZWFsS2V5ALc7Jnk=", "height": 2244753, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: DjNupLd74zpzo19usda4tfG3rAEAo1eNw6DDKj5orhag Next: 9wjTV58BXSA33YMHQzzcEzFiKfMKzJW7RwfK4iNzwJhH Diff:
Old | New | Differences | |
---|---|---|---|
72 | 72 | let E = ((((toString(x) + "_") + b) + "_") + y) | |
73 | 73 | let F = ("reveal_" + E) | |
74 | 74 | let G = ((("top_" + toString(x)) + "_") + t) | |
75 | - | let H = valueOrErrorMessage(getInteger(this, ("bid_" + E)), ("Bid doesn't exists" + y)) | |
75 | + | let H = valueOrErrorMessage(getInteger(this, ("bid_" + E)), ("Bid doesn't exists " + y)) | |
76 | 76 | let I = m() | |
77 | 77 | let o = I._1 | |
78 | 78 | let C = I._2 |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 6 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | func a (b,c) = valueOrErrorMessage(getInteger(b, c), ((("Can't read '" + c) + "' at address ") + toString(b))) | |
5 | 5 | ||
6 | 6 | ||
7 | 7 | func d (b,c,e) = valueOrElse(getInteger(b, c), e) | |
8 | 8 | ||
9 | 9 | ||
10 | 10 | func f (g,e) = valueOrElse(parseInt(g), e) | |
11 | 11 | ||
12 | 12 | ||
13 | 13 | let h = a(this, "init_timestamp") | |
14 | 14 | ||
15 | 15 | let i = a(this, "bid_duration") | |
16 | 16 | ||
17 | 17 | let j = a(this, "reveal_duration") | |
18 | 18 | ||
19 | 19 | let k = a(this, "error_fee") | |
20 | 20 | ||
21 | 21 | let l = a(this, "minimal_bid") | |
22 | 22 | ||
23 | 23 | func m () = { | |
24 | 24 | let n = (i + j) | |
25 | 25 | let o = ((lastBlock.timestamp - h) / n) | |
26 | 26 | let p = ((o * n) + h) | |
27 | 27 | let q = (lastBlock.timestamp - p) | |
28 | 28 | let r = if ((q > i)) | |
29 | 29 | then "reveal" | |
30 | 30 | else "bid" | |
31 | 31 | $Tuple2(o, r) | |
32 | 32 | } | |
33 | 33 | ||
34 | 34 | ||
35 | 35 | func s (t,u) = toBase58String(blake2b256_16Kb(keccak256_16Kb((toBytes(t) + toBytes(u))))) | |
36 | 36 | ||
37 | 37 | ||
38 | 38 | @Callable(v) | |
39 | 39 | func init (w,i,j,k,l) = if ((this != v.caller)) | |
40 | 40 | then throw("only self calls are allowed") | |
41 | 41 | else [IntegerEntry("init_timestamp", w), IntegerEntry("bid_duration", i), IntegerEntry("reveal_duration", j), IntegerEntry("error_fee", k), IntegerEntry("minimal_bid", l)] | |
42 | 42 | ||
43 | 43 | ||
44 | 44 | ||
45 | 45 | @Callable(v) | |
46 | 46 | func bid (x,y) = { | |
47 | 47 | let b = toString(v.caller) | |
48 | 48 | let z = ((((("bid_" + toString(x)) + "_") + b) + "_") + y) | |
49 | 49 | let A = if (if ((size(v.payments) == 1)) | |
50 | 50 | then (v.payments[0].assetId == unit) | |
51 | 51 | else false) | |
52 | 52 | then v.payments[0].amount | |
53 | 53 | else throw("Single payment required") | |
54 | 54 | let B = m() | |
55 | 55 | let o = B._1 | |
56 | 56 | let C = B._2 | |
57 | 57 | if ((o != x)) | |
58 | 58 | then throw("Auctions is already over") | |
59 | 59 | else if ((C != "bid")) | |
60 | 60 | then throw("Bid period is over") | |
61 | 61 | else if (isDefined(getInteger(this, z))) | |
62 | 62 | then throw("Bid with exact amount already presented") | |
63 | 63 | else [IntegerEntry(z, A)] | |
64 | 64 | } | |
65 | 65 | ||
66 | 66 | ||
67 | 67 | ||
68 | 68 | @Callable(v) | |
69 | 69 | func reveal (x,t,D) = { | |
70 | 70 | let b = toString(v.caller) | |
71 | 71 | let y = s(t, D) | |
72 | 72 | let E = ((((toString(x) + "_") + b) + "_") + y) | |
73 | 73 | let F = ("reveal_" + E) | |
74 | 74 | let G = ((("top_" + toString(x)) + "_") + t) | |
75 | - | let H = valueOrErrorMessage(getInteger(this, ("bid_" + E)), ("Bid doesn't exists" + y)) | |
75 | + | let H = valueOrErrorMessage(getInteger(this, ("bid_" + E)), ("Bid doesn't exists " + y)) | |
76 | 76 | let I = m() | |
77 | 77 | let o = I._1 | |
78 | 78 | let C = I._2 | |
79 | 79 | if ((o != x)) | |
80 | 80 | then throw("Auctions is already over") | |
81 | 81 | else if ((C != "reveal")) | |
82 | 82 | then throw("Reveal period is over") | |
83 | 83 | else if (isDefined(getString(this, F))) | |
84 | 84 | then throw("Bid is already revealed") | |
85 | 85 | else { | |
86 | 86 | let J = [StringEntry(F, ((((toString(H) + ",") + toString(D)) + ",") + t))] | |
87 | 87 | let K = getString(this, G) | |
88 | 88 | if (isDefined(K)) | |
89 | 89 | then { | |
90 | 90 | let L = value(getString(this, value(K))) | |
91 | 91 | let M = parseIntValue(split(L, ",")[1]) | |
92 | 92 | if (if ((D > M)) | |
93 | 93 | then (H >= D) | |
94 | 94 | else false) | |
95 | 95 | then (J :+ StringEntry(G, F)) | |
96 | 96 | else J | |
97 | 97 | } | |
98 | 98 | else (J :+ StringEntry(G, F)) | |
99 | 99 | } | |
100 | 100 | } | |
101 | 101 | ||
102 | 102 |
github/deemru/w8io/169f3d6 28.13 ms ◑