tx · 9gwjCMJYVeUAQ9k64jja42jBFM8mephMhApvLJ4tuqf7

3N2icgpJnXhcYab7KQrwqWsV4LwSF25C1Ep:  -0.01400000 Waves

2019.07.11 13:32 [580918] smart account 3N2icgpJnXhcYab7KQrwqWsV4LwSF25C1Ep > SELF 0.00000000 Waves

{ "type": 13, "id": "9gwjCMJYVeUAQ9k64jja42jBFM8mephMhApvLJ4tuqf7", "fee": 1400000, "feeAssetId": null, "timestamp": 1562841133851, "version": 1, "sender": "3N2icgpJnXhcYab7KQrwqWsV4LwSF25C1Ep", "senderPublicKey": "BJAeTqNbDSA5FiYihZZaSWvD6XL5XjpqVXbTGerBJjRK", "proofs": [ "3EBKdod9wtLWUmHoGJX4TsAJgUNHQnqToWhvfiMCygJ1fpMWKpsRWWoeAa31UAUQnKMwKh91XM7smdrCxhvmEDwr" ], "script": "base64:AAIDAAAAAAAAAAAAAAACAAAAAAd0b2tlbklkAQAAACCU1B7l35UfeySUCJ5Oe8nTMKHr4huFqp+vPk8CQCqTZQEAAAASdXNlckhhc0FkbWluQWNjZXNzAAAAAQAAAAdhZGRyZXNzCQAAAAAAAAIFAAAAB2FkZHJlc3MFAAAABHRoaXMAAAADAAAAAWkBAAAAA2JldAAAAAAEAAAAFnN0YXJ0VHJhbnNhY3Rpb25IZWlnaHQJAQAAABFAZXh0ck5hdGl2ZSgxMDUwKQAAAAIFAAAABHRoaXMCAAAABXN0YXJ0BAAAAAl0aW1lRGVsdGEJAABlAAAAAgUAAAAGaGVpZ2h0BQAAABZzdGFydFRyYW5zYWN0aW9uSGVpZ2h0BAAAAAZtYXhCZXQJAQAAAAdleHRyYWN0AAAAAQkABBoAAAACBQAAAAR0aGlzAgAAAAZtYXhCZXQEAAAAC21heEJldE93bmVyCQEAAAAUYWRkcmVzc0Zyb21QdWJsaWNLZXkAAAABCQABmwAAAAEJAQAAABFAZXh0ck5hdGl2ZSgxMDUzKQAAAAIFAAAABHRoaXMCAAAAC21heEJldE93bmVyBAAAAANwbXQJ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BQAAAAZoZWlnaHQJAARMAAAAAgkBAAAACURhdGFFbnRyeQAAAAICAAAABm1heEJldAUAAAAKc3RhcnRQcmljZQkABEwAAAACCQEAAAAJRGF0YUVudHJ5AAAAAgIAAAALbWF4QmV0T3duZXIJAAJYAAAAAQgFAAAAAWkAAAAPY2FsbGVyUHVibGljS2V5BQAAAANuaWwAAAABaQEAAAAGZmluaXNoAAAAAAMJAQAAAAEhAAAAAQkBAAAAEnVzZXJIYXNBZG1pbkFjY2VzcwAAAAEIBQAAAAFpAAAABmNhbGxlcgkAAAIAAAABAgAAABNZb3UgaGF2ZSBubyBhY2Nlc3MhBAAAAAttYXhCZXRPd25lcgkBAAAAFGFkZHJlc3NGcm9tUHVibGljS2V5AAAAAQkAAZsAAAABCQEAAAARQGV4dHJOYXRpdmUoMTA1MykAAAACBQAAAAR0aGlzAgAAAAttYXhCZXRPd25lcgkBAAAADFNjcmlwdFJlc3VsdAAAAAIJAQAAAAhXcml0ZVNldAAAAAEJAARMAAAAAgkBAAAACURhdGFFbnRyeQAAAAICAAAABXN0YXJ0AAAAAAAAAAAABQAAAANuaWwJAQAAAAtUcmFuc2ZlclNldAAAAAEJAARMAAAAAgkBAAAADlNjcmlwdFRyYW5zZmVyAAAAAwUAAAALbWF4QmV0T3duZXIAAAAAAAAAAAEFAAAAB3Rva2VuSWQFAAAAA25pbAAAAAAtiviW", "chainId": 84, "height": 580918, "spentComplexity": 0 } View: original | compacted Prev: Ey3ZWzYzuzkJAcvQnXGipFFh1yTNLp4JeBufdCW5cjzM Next: j5SYJKcaTsx5Lc6m9PC9fXPCW2FkuU1zw3qLKDrhgJM Diff:
OldNewDifferences
11 {-# STDLIB_VERSION 3 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
4-func a (b) = (b == this)
4+let a = base58'B1xwWnBLB7z79VPr4sq1jBb5GDqs8TeT5jHojTdiwxfE'
5+
6+func b (c) = (c == this)
57
68
7-@Callable(c)
9+@Callable(d)
810 func bet () = {
9- let d = getIntegerValue(this, "start")
10- let e = (height - d)
11- let f = extract(getInteger(this, "maxBet"))
12- let g = addressFromPublicKey(toBytes(getStringValue(this, "maxBetOwner")))
13- let h = extract(c.payment)
14- if ((e > 2000))
11+ let e = getIntegerValue(this, "start")
12+ let f = (height - e)
13+ let g = extract(getInteger(this, "maxBet"))
14+ let h = addressFromPublicKey(toBytes(getStringValue(this, "maxBetOwner")))
15+ let i = extract(d.payment)
16+ if ((f > 2000))
1517 then throw("The betting was closed")
16- else if (!(isDefined(h.assetId)))
18+ else if (!(isDefined(i.assetId)))
1719 then {
18- let i = h.amount
19- if ((i > f))
20- then ScriptResult(WriteSet([DataEntry("maxBet", i), DataEntry("maxBetOwner", toBase58String(c.callerPublicKey)), DataEntry(toBase58String(c.callerPublicKey), i)]), TransferSet([ScriptTransfer(g, f, unit)]))
20+ let j = i.amount
21+ if ((j > g))
22+ then ScriptResult(WriteSet([DataEntry("maxBet", j), DataEntry("maxBetOwner", toBase58String(d.callerPublicKey)), DataEntry(toBase58String(d.callerPublicKey), j)]), TransferSet([ScriptTransfer(h, g, unit)]))
2123 else throw("Your bet isn't the max bet")
2224 }
2325 else throw("You need to place a bet using waves currency")
2527
2628
2729
28-@Callable(c)
29-func start (j) = if (!(a(c.caller)))
30+@Callable(d)
31+func start (k) = if (!(b(d.caller)))
3032 then throw("You have no access!")
31- else WriteSet([DataEntry("start", height), DataEntry("maxBet", j), DataEntry("maxBetOwner", toBase58String(c.callerPublicKey))])
33+ else WriteSet([DataEntry("start", height), DataEntry("maxBet", k), DataEntry("maxBetOwner", toBase58String(d.callerPublicKey))])
3234
3335
3436
35-@Callable(c)
36-func finish () = if (!(a(c.caller)))
37+@Callable(d)
38+func finish () = if (!(b(d.caller)))
3739 then throw("You have no access!")
3840 else {
39- let g = addressFromPublicKey(toBytes(getStringValue(this, "maxBetOwner")))
40- ScriptResult(WriteSet([DataEntry("start", 0)]), TransferSet([ScriptTransfer(g, 1, toBytes("B1xwWnBLB7z79VPr4sq1jBb5GDqs8TeT5jHojTdiwxfE"))]))
41+ let h = addressFromPublicKey(toBytes(getStringValue(this, "maxBetOwner")))
42+ ScriptResult(WriteSet([DataEntry("start", 0)]), TransferSet([ScriptTransfer(h, 1, a)]))
4143 }
4244
4345
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 3 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
4-func a (b) = (b == this)
4+let a = base58'B1xwWnBLB7z79VPr4sq1jBb5GDqs8TeT5jHojTdiwxfE'
5+
6+func b (c) = (c == this)
57
68
7-@Callable(c)
9+@Callable(d)
810 func bet () = {
9- let d = getIntegerValue(this, "start")
10- let e = (height - d)
11- let f = extract(getInteger(this, "maxBet"))
12- let g = addressFromPublicKey(toBytes(getStringValue(this, "maxBetOwner")))
13- let h = extract(c.payment)
14- if ((e > 2000))
11+ let e = getIntegerValue(this, "start")
12+ let f = (height - e)
13+ let g = extract(getInteger(this, "maxBet"))
14+ let h = addressFromPublicKey(toBytes(getStringValue(this, "maxBetOwner")))
15+ let i = extract(d.payment)
16+ if ((f > 2000))
1517 then throw("The betting was closed")
16- else if (!(isDefined(h.assetId)))
18+ else if (!(isDefined(i.assetId)))
1719 then {
18- let i = h.amount
19- if ((i > f))
20- then ScriptResult(WriteSet([DataEntry("maxBet", i), DataEntry("maxBetOwner", toBase58String(c.callerPublicKey)), DataEntry(toBase58String(c.callerPublicKey), i)]), TransferSet([ScriptTransfer(g, f, unit)]))
20+ let j = i.amount
21+ if ((j > g))
22+ then ScriptResult(WriteSet([DataEntry("maxBet", j), DataEntry("maxBetOwner", toBase58String(d.callerPublicKey)), DataEntry(toBase58String(d.callerPublicKey), j)]), TransferSet([ScriptTransfer(h, g, unit)]))
2123 else throw("Your bet isn't the max bet")
2224 }
2325 else throw("You need to place a bet using waves currency")
2426 }
2527
2628
2729
28-@Callable(c)
29-func start (j) = if (!(a(c.caller)))
30+@Callable(d)
31+func start (k) = if (!(b(d.caller)))
3032 then throw("You have no access!")
31- else WriteSet([DataEntry("start", height), DataEntry("maxBet", j), DataEntry("maxBetOwner", toBase58String(c.callerPublicKey))])
33+ else WriteSet([DataEntry("start", height), DataEntry("maxBet", k), DataEntry("maxBetOwner", toBase58String(d.callerPublicKey))])
3234
3335
3436
35-@Callable(c)
36-func finish () = if (!(a(c.caller)))
37+@Callable(d)
38+func finish () = if (!(b(d.caller)))
3739 then throw("You have no access!")
3840 else {
39- let g = addressFromPublicKey(toBytes(getStringValue(this, "maxBetOwner")))
40- ScriptResult(WriteSet([DataEntry("start", 0)]), TransferSet([ScriptTransfer(g, 1, toBytes("B1xwWnBLB7z79VPr4sq1jBb5GDqs8TeT5jHojTdiwxfE"))]))
41+ let h = addressFromPublicKey(toBytes(getStringValue(this, "maxBetOwner")))
42+ ScriptResult(WriteSet([DataEntry("start", 0)]), TransferSet([ScriptTransfer(h, 1, a)]))
4143 }
4244
4345

github/deemru/w8io/169f3d6 
48.03 ms