tx · 6t5YZKTzbM3YyYw85eJKABYHBnUx1GT5Z9jmbRvVfdnc

3MqLtJ49xFdzpVh8kJoaumrRN9GYXLrScMk:  -0.01400000 Waves

2019.07.30 16:22 [608888] smart account 3MqLtJ49xFdzpVh8kJoaumrRN9GYXLrScMk > SELF 0.00000000 Waves

{ "type": 13, "id": "6t5YZKTzbM3YyYw85eJKABYHBnUx1GT5Z9jmbRvVfdnc", "fee": 1400000, "feeAssetId": null, "timestamp": 1564493029694, "version": 1, "sender": "3MqLtJ49xFdzpVh8kJoaumrRN9GYXLrScMk", "senderPublicKey": "5XLU4PwAQXZGmcUD3QtB2pXeV3VBEBp8cvA9NnTiv2mW", "proofs": [ "xEU6TBP6Bk3svj7585HNeHAHJuaAdcawRm6Mpv93kX6h8R3iLCFXK4zgTEiFjz7YL2qH9sNFYkP5P9YffDsdLf3" ], "script": "base64:AAIDAAAAAAAAAAAAAAAJAAAAAApiZXRBc3NldElkAQAAACAea7QCZF/XAXMBPEnDQ5kqHUHyOfWmXu9KHDHL6zcNNwAAAAAGbWF4RmVlAAAAAAAATEtAAAAAAAZtaW5CZXQAAAAAAABMS0AAAAAAD21pbk1hdGNoTm9taW5hbAAAAAAAAExLQAEAAAAIY2hlY2tGZWUAAAABAAAAAWkDCQAAZgAAAAIIBQAAAAFpAAAAA2ZlZQUAAAAGbWF4RmVlCQAAAgAAAAECAAAAFnVucmVhc29uYWJsZSBsYXJnZSBmZWUDCQEAAAACIT0AAAACCAUAAAABaQAAAApmZWVBc3NldElkBQAAAAR1bml0CQAAAgAAAAECAAAAFGZlZSBtdXN0IGJlIGluIFdBVkVTBgEAAAAIcmVwYXlGZWUAAAADAAAAAWkAAAACd3MAAAAGYW1vdW50AwkBAAAACGNoZWNrRmVlAAAAAQUAAAABaQkBAAAADFNjcmlwdFJlc3VsdAAAAAIFAAAAAndzCQEAAAALVHJhbnNmZXJTZXQAAAABCQAETAAAAAIJAQAAAA5TY3JpcHRUcmFuc2ZlcgAAAAMIBQAA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AAAIFAAAADXdpbm5lckFkZHJlc3MJAAJYAAAAAQgIBQAAAAFpAAAABmNhbGxlcgAAAAVieXRlcwkAAAIAAAABAgAAACtwYXl3aW5uZXIoKSBzaG91bGQgYmUgY2FsbGVkIGJ5IHdpbm5lciBvbmx5BAAAAAZhbW91bnQJAQAAAAdleHRyYWN0AAAAAQkABBoAAAACBQAAAAR0aGlzCQABLAAAAAIFAAAAB21hdGNoSWQCAAAAB19hbW91bnQJAQAAAAhyZXBheUZlZQAAAAMFAAAAAWkJAQAAAAhXcml0ZVNldAAAAAEJAARMAAAAAgkBAAAACURhdGFFbnRyeQAAAAIJAAEsAAAAAgUAAAAHbWF0Y2hJZAIAAAAFX3BhaWQFAAAABmFtb3VudAUAAAADbmlsBQAAAAZhbW91bnQAAAAAOA27SA==", "chainId": 84, "height": 608888, "spentComplexity": 0 } View: original | compacted Prev: B2DFhhPHXu5nU4QmwRjLFYzRh35LxHKvPoL6jSQBcwQy Next: J93oV3u4Y7Z3hzJ53iZQVYw8AUF17Waea528bGXZq2DE Diff:
OldNewDifferences
4848 else false)
4949 then throw("unexpected side")
5050 else {
51- let k = (((((("bet_" + o) + "_") + toBase58String(f.caller.bytes)) + "_") + take(toBase58String(f.transactionId), 8)) + "_")
51+ let k = (((((("bet_" + o) + "_") + toBase58String(f.caller.bytes)) + "_") + take(toBase64String(f.transactionId), 15)) + "_")
5252 let u = {
5353 let v = getInteger(this, ((("seq_" + o) + "_") + p))
5454 if ($isInstanceOf(v, "Int"))
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 3 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let a = base58'33kV5hRVtgEGpYqhp9wQn2g9hP1fNWSYGCzzYk1T9Hyg'
55
66 let b = 5000000
77
88 let c = 5000000
99
1010 let d = 5000000
1111
1212 func e (f) = if ((f.fee > b))
1313 then throw("unreasonable large fee")
1414 else if ((f.feeAssetId != unit))
1515 then throw("fee must be in WAVES")
1616 else true
1717
1818
1919 func g (f,h,i) = if (e(f))
2020 then ScriptResult(h, TransferSet([ScriptTransfer(f.caller, f.fee, unit)]))
2121 else throw("error")
2222
2323
2424 func j (f,k) = (getString(this, (k + "_owner")) == toBase58String(f.caller.bytes))
2525
2626
2727 func l (k) = (extract(getInteger(this, (k + "_amount"))) - extract(getInteger(this, (k + "_spent"))))
2828
2929
3030 func m (k) = {
3131 let n = getInteger(this, (k + "_defeat"))
3232 if ((n == 1))
3333 then true
3434 else (n == 3)
3535 }
3636
3737
3838 @Callable(f)
3939 func bet (o,p,q,r) = {
4040 let s = toBase58String(f.caller.bytes)
4141 let t = extract(f.payment)
4242 if ((t.assetId != a))
4343 then throw(("bet must be in asset " + toBase58String(a)))
4444 else if ((c > t.amount))
4545 then throw(("minimum allowed bet is " + toString(c)))
4646 else if (if ((q != "for"))
4747 then (q != "against")
4848 else false)
4949 then throw("unexpected side")
5050 else {
51- let k = (((((("bet_" + o) + "_") + toBase58String(f.caller.bytes)) + "_") + take(toBase58String(f.transactionId), 8)) + "_")
51+ let k = (((((("bet_" + o) + "_") + toBase58String(f.caller.bytes)) + "_") + take(toBase64String(f.transactionId), 15)) + "_")
5252 let u = {
5353 let v = getInteger(this, ((("seq_" + o) + "_") + p))
5454 if ($isInstanceOf(v, "Int"))
5555 then {
5656 let w = v
5757 (w + 1)
5858 }
5959 else 1
6060 }
6161 g(f, WriteSet([DataEntry((k + "owner"), s), DataEntry((k + "event"), o), DataEntry((k + "subevent"), p), DataEntry((k + "side"), q), DataEntry((k + "odds"), r), DataEntry((k + "amount"), t.amount), DataEntry((k + "spent"), 0), DataEntry((k + "timestamp"), lastBlock.timestamp), DataEntry((k + "sequence"), u)]), 0)
6262 }
6363 }
6464
6565
6666
6767 @Callable(f)
6868 func cancel (k) = if (!(j(f, k)))
6969 then throw("permission denied")
7070 else {
7171 let i = extract(getInteger(this, (k + "_amount")))
7272 let x = extract(getInteger(this, (k + "_spent")))
7373 let y = (i - x)
7474 g(f, WriteSet([DataEntry((k + "_spent"), i), DataEntry((k + "_cancel_amount"), y)]), y)
7575 }
7676
7777
7878
7979 @Callable(f)
8080 func betMatch (z,A) = if ((getString(this, (z + "_event")) != getString(this, (A + "_event"))))
8181 then throw("event id must match")
8282 else if ((getString(this, (z + "_subevent")) != getString(this, (A + "_subevent"))))
8383 then throw("subevent id must match")
8484 else if ((getString(this, (z + "_side")) != "for"))
8585 then throw("invalid *for* bet")
8686 else if ((getString(this, (A + "_side")) != "against"))
8787 then throw("invalid *against* bet")
8888 else {
8989 let B = extract(getString(this, (z + "_event")))
9090 let C = (((((((("match_" + z) + "_") + A) + "_") + B) + "_") + toBase58String(f.transactionId)) + "_")
9191 let r = extract(getInteger(this, (z + "_odds")))
9292 let D = l(z)
9393 let E = l(A)
9494 let F = D
9595 let G = ((E * 100) / r)
9696 let H = if ((F > G))
9797 then G
9898 else F
9999 if ((d > H))
100100 then throw("match nominal too low")
101101 else {
102102 let I = H
103103 let J = ((H * r) / 100)
104104 let K = (I + D)
105105 let L = (J + E)
106106 if ((K > extract(getInteger(this, (z + "_amount")))))
107107 then throw("invalid match")
108108 else if ((L > extract(getInteger(this, (A + "_amount")))))
109109 then throw("invalid match")
110110 else g(f, WriteSet([DataEntry((C + "amount"), (I + J)), DataEntry((C + "for"), z), DataEntry((C + "against"), A), DataEntry((z + "_spent"), K), DataEntry((A + "_spent"), L)]), 0)
111111 }
112112 }
113113
114114
115115
116116 @Callable(f)
117117 func approveDefeat (M,N) = if (if (isDefined(getInteger(this, (M + "_defeat"))))
118118 then (N == 2)
119119 else false)
120120 then throw("can't dispute after approve")
121121 else g(f, WriteSet([DataEntry((M + "_defeat"), N)]), 0)
122122
123123
124124
125125 @Callable(f)
126126 func payWinner (O) = if (isDefined(getInteger(this, (O + "_paid"))))
127127 then throw("already paid")
128128 else {
129129 let P = extract(getString(this, (O + "_for")))
130130 let Q = extract(getString(this, (O + "_against")))
131131 let R = m(P)
132132 let S = m(Q)
133133 if (if (!(R))
134134 then !(S)
135135 else false)
136136 then throw("no side approved defeat")
137137 else {
138138 let T = if (R)
139139 then Q
140140 else P
141141 let U = getString(this, (T + "_owner"))
142142 if ((U != toBase58String(f.caller.bytes)))
143143 then throw("paywinner() should be called by winner only")
144144 else {
145145 let i = extract(getInteger(this, (O + "_amount")))
146146 g(f, WriteSet([DataEntry((O + "_paid"), i)]), i)
147147 }
148148 }
149149 }
150150
151151

github/deemru/w8io/169f3d6 
32.03 ms