tx · GhxYTQgZsJMj63TeLxnYjgQKxWseGuf5R9sn6JSE5YrG

3ND17nVaEvRLifxdkwXmXZwBvuYwefCMErS:  -0.01400000 Waves

2019.08.05 15:44 [617616] smart account 3ND17nVaEvRLifxdkwXmXZwBvuYwefCMErS > SELF 0.00000000 Waves

{ "type": 13, "id": "GhxYTQgZsJMj63TeLxnYjgQKxWseGuf5R9sn6JSE5YrG", "fee": 1400000, "feeAssetId": null, "timestamp": 1565009079513, "version": 1, "sender": "3ND17nVaEvRLifxdkwXmXZwBvuYwefCMErS", "senderPublicKey": "GDy5pgY6ePCFGV6tWjg7nLZQ8U4tXHg2jxbKBe5MHXtd", "proofs": [ "JRowY4UXXvEvhceZLGQYAW941jBattPwsQnn1D5PUzEA4UZA225jxLi4vAgTJayqafcYpBNttB2cnjEo3c44vYE" ], "script": "base64:AAIDAAAAAAAAAAAAAAAJAAAAAApiZXRBc3NldElkAQAAACAea7QCZF/XAXMBPEnDQ5kqHUHyOfWmXu9KHDHL6zcNNwAAAAAGbWF4RmVlAAAAAAAATEtAAAAAAAZtaW5CZXQAAAAAAABMS0AAAAAAD21pbk1hdGNoTm9taW5hbAAAAAAAAExLQAEAAAAIY2hlY2tGZWUAAAABAAAAAWkDCQAAZgAAAAIIBQAAAAFpAAAAA2ZlZQUAAAAGbWF4RmVlCQAAAgAAAAECAAAAFnVucmVhc29uYWJsZSBsYXJnZSBmZWUDCQEAAAACIT0AAAACCAUAAAABaQAAAApmZWVBc3NldElkBQAAAAR1bml0CQAAAgAAAAECAAAAFGZlZSBtdXN0IGJlIGluIFdBVkVTBgEAAAAIcmVwYXlGZWUAAAADAAAAAWkAAAACd3MAAAAGYW1vdW50AwkBAAAACGNoZWNrRmVlAAAAAQUAAAABaQkBAAAADFNjcmlwdFJlc3VsdAAAAAIFAAAAAndzCQEAAAALVHJhbnNmZXJTZXQAAAABCQAETAAAAAIJAQAAAA5TY3JpcHRUcmFuc2ZlcgAAAAMIBQAAAAFpAAAABmNhbGxlc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AAGYW1vdW50BQAAAANuaWwFAAAABmFtb3VudAAAAADYGzQW", "chainId": 84, "height": 617616, "spentComplexity": 0 } View: original | compacted Prev: 9S2sxaXkiQjNoJX4RTRRe4ZjBNUzcsykCeAHj8oyN9Hp Next: AFY7L4kXfB76pdZijAFCkWLu2QQpMv8xi4GJi8aFZbJj Diff:
OldNewDifferences
1717
1818
1919 func g (f,h,i) = if (e(f))
20- then ScriptResult(h, TransferSet([ScriptTransfer(f.caller, f.fee, unit)]))
20+ then ScriptResult(h, TransferSet([ScriptTransfer(f.caller, f.fee, unit), ScriptTransfer(f.caller, i, a)]))
2121 else throw("error")
2222
2323
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))
20- then ScriptResult(h, TransferSet([ScriptTransfer(f.caller, f.fee, unit)]))
20+ then ScriptResult(h, TransferSet([ScriptTransfer(f.caller, f.fee, unit), ScriptTransfer(f.caller, i, a)]))
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 {
5151 let k = (((((("bet_" + o) + "_") + toBase58String(f.caller.bytes)) + "_") + take(toBase64String(f.transactionId), 15)) + "_")
5252 let u = ((("seq_" + o) + "_") + p)
5353 let v = {
5454 let w = getInteger(this, u)
5555 if ($isInstanceOf(w, "Int"))
5656 then {
5757 let x = w
5858 (x + 1)
5959 }
6060 else 1
6161 }
6262 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"), v), DataEntry(u, v)]), 0)
6363 }
6464 }
6565
6666
6767
6868 @Callable(f)
6969 func cancel (k) = if (!(j(f, k)))
7070 then throw("permission denied")
7171 else {
7272 let i = extract(getInteger(this, (k + "_amount")))
7373 let y = extract(getInteger(this, (k + "_spent")))
7474 let z = (i - y)
7575 g(f, WriteSet([DataEntry((k + "_spent"), i), DataEntry((k + "_cancel_amount"), z)]), z)
7676 }
7777
7878
7979
8080 @Callable(f)
8181 func betMatch (A,B) = if ((getString(this, (A + "_event")) != getString(this, (B + "_event"))))
8282 then throw("event id must match")
8383 else if ((getString(this, (A + "_subevent")) != getString(this, (B + "_subevent"))))
8484 then throw("subevent id must match")
8585 else if ((getString(this, (A + "_side")) != "for"))
8686 then throw("invalid *for* bet")
8787 else if ((getString(this, (B + "_side")) != "against"))
8888 then throw("invalid *against* bet")
8989 else {
9090 let C = getStringValue(this, (A + "_owner"))
9191 let D = getStringValue(this, (B + "_owner"))
9292 let E = extract(getString(this, (A + "_event")))
9393 let F = (((((((("match_" + E) + "_") + takeRight(C, 10)) + "_") + takeRight(D, 10)) + "_") + toBase58String(f.transactionId)) + "_")
9494 let r = extract(getInteger(this, (A + "_odds")))
9595 let G = l(A)
9696 let H = l(B)
9797 let I = G
9898 let J = ((H * 100) / (r - 100))
9999 let K = if ((I > J))
100100 then J
101101 else I
102102 if ((d > K))
103103 then throw("match nominal too low")
104104 else {
105105 let L = K
106106 let M = ((K * (r - 100)) / 100)
107107 let N = (L + extract(getInteger(this, (A + "_spent"))))
108108 let O = (M + extract(getInteger(this, (B + "_spent"))))
109109 if ((N > extract(getInteger(this, (A + "_amount")))))
110110 then throw("invalid match")
111111 else if ((O > extract(getInteger(this, (B + "_amount")))))
112112 then throw("invalid match")
113113 else g(f, WriteSet([DataEntry((F + "amount"), (L + M)), DataEntry((F + "for"), A), DataEntry((F + "against"), B), DataEntry((A + "_spent"), N), DataEntry((B + "_spent"), O)]), 0)
114114 }
115115 }
116116
117117
118118
119119 @Callable(f)
120120 func approveDefeat (P,Q) = if (if (isDefined(getInteger(this, (P + "_defeat"))))
121121 then (Q == 2)
122122 else false)
123123 then throw("can't dispute after approve")
124124 else g(f, WriteSet([DataEntry((P + "_defeat"), Q)]), 0)
125125
126126
127127
128128 @Callable(f)
129129 func payWinner (R) = if (isDefined(getInteger(this, (R + "_paid"))))
130130 then throw("already paid")
131131 else {
132132 let S = extract(getString(this, (R + "_for")))
133133 let T = extract(getString(this, (R + "_against")))
134134 let U = m(S)
135135 let V = m(T)
136136 if (if (!(U))
137137 then !(V)
138138 else false)
139139 then throw("no side approved defeat")
140140 else {
141141 let W = if (U)
142142 then T
143143 else S
144144 let X = getString(this, (W + "_owner"))
145145 if ((X != toBase58String(f.caller.bytes)))
146146 then throw("paywinner() should be called by winner only")
147147 else {
148148 let i = extract(getInteger(this, (R + "_amount")))
149149 g(f, WriteSet([DataEntry((R + "_paid"), i)]), i)
150150 }
151151 }
152152 }
153153
154154

github/deemru/w8io/026f985 
35.67 ms