tx · agNycTAweMLSH4fKaFKiQ5KVkEG6WBS9CVZJYgCPcty

3N2icgpJnXhcYab7KQrwqWsV4LwSF25C1Ep:  -0.01400000 Waves

2019.07.11 12:21 [580844] smart account 3N2icgpJnXhcYab7KQrwqWsV4LwSF25C1Ep > SELF 0.00000000 Waves

{ "type": 13, "id": "agNycTAweMLSH4fKaFKiQ5KVkEG6WBS9CVZJYgCPcty", "fee": 1400000, "feeAssetId": null, "timestamp": 1562836952509, "version": 1, "sender": "3N2icgpJnXhcYab7KQrwqWsV4LwSF25C1Ep", "senderPublicKey": "BJAeTqNbDSA5FiYihZZaSWvD6XL5XjpqVXbTGerBJjRK", "proofs": [ "yU1RrVVYzemqbdd9L3JwXDmwQAytamW8zwrjwSm3CCH7fjEHNCpuawwGciBrtb4CPn2573HpSXaBXv1bZzgNQkq" ], "script": "base64:AAIDAAAAAAAAAAAAAAABAQAAABJ1c2VySGFzQWRtaW5BY2Nlc3MAAAABAAAAB2FkZHJlc3MJAAAAAAAAAgUAAAAHYWRkcmVzcwUAAAAEdGhpcwAAAAIAAAABaQEAAAADYmV0AAAAAQAAAAVwcmljZQQAAAAWc3RhcnRUcmFuc2FjdGlvbkhlaWdodAkBAAAAEUBleHRyTmF0aXZlKDEwNTApAAAAAgUAAAAEdGhpcwIAAAAFc3RhcnQEAAAACXRpbWVEZWx0YQkAAGUAAAACBQAAAAZoZWlnaHQFAAAAFnN0YXJ0VHJhbnNhY3Rpb25IZWlnaHQEAAAABm1heEJldAkBAAAAB2V4dHJhY3QAAAABCQAEGgAAAAIFAAAABHRoaXMCAAAABm1heEJldAQAAAALbWF4QmV0T3duZXIJAQAAABRhZGRyZXNzRnJvbVB1YmxpY0tleQAAAAEJAQAAAAdleHRyYWN0AAAAAQkABBwAAAACBQAAAAR0aGlzAgAAAAttYXhCZXRPd25lcgMJAABmAAAAAgUAAAAJdGltZURlbHRhAAAAAAAAAAfQCQAAAgAAAAECAAAAFlRoZSBiZXR0aW5nIHdhcyBjbG9z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bAAAAAD+zjxp", "chainId": 84, "height": 580844, "spentComplexity": 0 } View: original | compacted Prev: G3QVVbuAVYEsHsomeSDeaMpcCiJjAH5g6RvcJzMWXDW1 Next: 74TkubP6tTbzYWr1ykQ8aJSUFQvrogfxWejrAdUFi3GQ Diff:
OldNewDifferences
55
66
77 @Callable(c)
8-func bet () = {
9- let d = getIntegerValue(this, "start")
10- let e = (height - d)
11- let f = extract(getInteger(this, "maxBet"))
12- let g = addressFromPublicKey(extract(getBinary(this, "maxBetOwner")))
13- if ((e > 2000))
8+func bet (d) = {
9+ let e = getIntegerValue(this, "start")
10+ let f = (height - e)
11+ let g = extract(getInteger(this, "maxBet"))
12+ let h = addressFromPublicKey(extract(getBinary(this, "maxBetOwner")))
13+ if ((f > 2000))
1414 then throw("The betting was closed")
15- else {
16- let h = extract(c.payment)
17- if (!(isDefined(h.assetId)))
18- then if ((h.amount > f))
19- then ScriptResult(WriteSet([DataEntry("maxBet", h.amount), DataEntry("maxBetOwner", c.callerPublicKey), DataEntry(toBase58String(c.callerPublicKey), h.amount)]), TransferSet([ScriptTransfer(g, f, unit)]))
20- else throw("Your bet isn't the max bet")
21- else throw("You need to place a bet using waves currency")
22- }
15+ else if ((d > g))
16+ then ScriptResult(WriteSet([DataEntry("maxBet", d), DataEntry("maxBetOwner", toBase58String(c.callerPublicKey)), DataEntry(toBase58String(c.callerPublicKey), d)]), TransferSet([ScriptTransfer(h, g, unit), ScriptTransfer(this, (d - g), unit)]))
17+ else throw("Your bet isn't the max bet")
2318 }
2419
2520
2722 @Callable(c)
2823 func start (i) = if (!(a(c.caller)))
2924 then throw("You have no access!")
30- else WriteSet([DataEntry("start", height), DataEntry("maxBet", i), DataEntry("maxBetOwner", c.callerPublicKey)])
25+ else WriteSet([DataEntry("start", height), DataEntry("maxBet", i), DataEntry("maxBetOwner", toBase58String(c.callerPublicKey))])
3126
3227
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 3 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 func a (b) = (b == this)
55
66
77 @Callable(c)
8-func bet () = {
9- let d = getIntegerValue(this, "start")
10- let e = (height - d)
11- let f = extract(getInteger(this, "maxBet"))
12- let g = addressFromPublicKey(extract(getBinary(this, "maxBetOwner")))
13- if ((e > 2000))
8+func bet (d) = {
9+ let e = getIntegerValue(this, "start")
10+ let f = (height - e)
11+ let g = extract(getInteger(this, "maxBet"))
12+ let h = addressFromPublicKey(extract(getBinary(this, "maxBetOwner")))
13+ if ((f > 2000))
1414 then throw("The betting was closed")
15- else {
16- let h = extract(c.payment)
17- if (!(isDefined(h.assetId)))
18- then if ((h.amount > f))
19- then ScriptResult(WriteSet([DataEntry("maxBet", h.amount), DataEntry("maxBetOwner", c.callerPublicKey), DataEntry(toBase58String(c.callerPublicKey), h.amount)]), TransferSet([ScriptTransfer(g, f, unit)]))
20- else throw("Your bet isn't the max bet")
21- else throw("You need to place a bet using waves currency")
22- }
15+ else if ((d > g))
16+ then ScriptResult(WriteSet([DataEntry("maxBet", d), DataEntry("maxBetOwner", toBase58String(c.callerPublicKey)), DataEntry(toBase58String(c.callerPublicKey), d)]), TransferSet([ScriptTransfer(h, g, unit), ScriptTransfer(this, (d - g), unit)]))
17+ else throw("Your bet isn't the max bet")
2318 }
2419
2520
2621
2722 @Callable(c)
2823 func start (i) = if (!(a(c.caller)))
2924 then throw("You have no access!")
30- else WriteSet([DataEntry("start", height), DataEntry("maxBet", i), DataEntry("maxBetOwner", c.callerPublicKey)])
25+ else WriteSet([DataEntry("start", height), DataEntry("maxBet", i), DataEntry("maxBetOwner", toBase58String(c.callerPublicKey))])
3126
3227

github/deemru/w8io/169f3d6 
37.62 ms