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:AAIDAAAAAAAAAAAAAAABAQAAABJ1c2VySGFzQWRtaW5BY2Nlc3MAAAABAAAAB2FkZHJlc3MJAAAAAAAAAgUAAAAHYWRkcmVzcwUAAAAEdGhpcwAAAAIAAAABaQEAAAADYmV0AAAAAQAAAAVwcmljZQQAAAAWc3RhcnRUcmFuc2FjdGlvbkhlaWdodAkBAAAAEUBleHRyTmF0aXZlKDEwNTApAAAAAgUAAAAEdGhpcwIAAAAFc3RhcnQEAAAACXRpbWVEZWx0YQkAAGUAAAACBQAAAAZoZWlnaHQFAAAAFnN0YXJ0VHJhbnNhY3Rpb25IZWlnaHQEAAAABm1heEJldAkBAAAAB2V4dHJhY3QAAAABCQAEGgAAAAIFAAAABHRoaXMCAAAABm1heEJldAQAAAALbWF4QmV0T3duZXIJAQAAABRhZGRyZXNzRnJvbVB1YmxpY0tleQAAAAEJAQAAAAdleHRyYWN0AAAAAQkABBwAAAACBQAAAAR0aGlzAgAAAAttYXhCZXRPd25lcgMJAABmAAAAAgUAAAAJdGltZURlbHRhAAAAAAAAAAfQCQAAAgAAAAECAAAAFlRoZSBiZXR0aW5nIHdhcyBjbG9zZ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AAAAAD+zjxp", "chainId": 84, "height": 580844, "spentComplexity": 0 } View: original | compacted Prev: G3QVVbuAVYEsHsomeSDeaMpcCiJjAH5g6RvcJzMWXDW1 Next: 74TkubP6tTbzYWr1ykQ8aJSUFQvrogfxWejrAdUFi3GQ Diff:
Old | New | Differences | |
---|---|---|---|
5 | 5 | ||
6 | 6 | ||
7 | 7 | @Callable(c) | |
8 | - | func bet () = { | |
9 | - | let | |
10 | - | let | |
11 | - | let | |
12 | - | let | |
13 | - | if (( | |
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)) | |
14 | 14 | 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") | |
23 | 18 | } | |
24 | 19 | ||
25 | 20 | ||
27 | 22 | @Callable(c) | |
28 | 23 | func start (i) = if (!(a(c.caller))) | |
29 | 24 | 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))]) | |
31 | 26 | ||
32 | 27 |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 3 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | func a (b) = (b == this) | |
5 | 5 | ||
6 | 6 | ||
7 | 7 | @Callable(c) | |
8 | - | func bet () = { | |
9 | - | let | |
10 | - | let | |
11 | - | let | |
12 | - | let | |
13 | - | if (( | |
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)) | |
14 | 14 | 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") | |
23 | 18 | } | |
24 | 19 | ||
25 | 20 | ||
26 | 21 | ||
27 | 22 | @Callable(c) | |
28 | 23 | func start (i) = if (!(a(c.caller))) | |
29 | 24 | 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))]) | |
31 | 26 | ||
32 | 27 |
github/deemru/w8io/169f3d6 37.62 ms ◑