tx · 354Hg8yLXd1sviHwFS7LxEHADiYqPNXNjbDeSmWFGeEi
3N2icgpJnXhcYab7KQrwqWsV4LwSF25C1Ep: -0.01400000 Waves
2019.07.11 12:59 [580883] smart account 3N2icgpJnXhcYab7KQrwqWsV4LwSF25C1Ep > SELF 0.00000000 Waves
{
"type": 13,
"id": "354Hg8yLXd1sviHwFS7LxEHADiYqPNXNjbDeSmWFGeEi",
"fee": 1400000,
"feeAssetId": null,
"timestamp": 1562839277541,
"version": 1,
"sender": "3N2icgpJnXhcYab7KQrwqWsV4LwSF25C1Ep",
"senderPublicKey": "BJAeTqNbDSA5FiYihZZaSWvD6XL5XjpqVXbTGerBJjRK",
"proofs": [
"5pi4A6TD5AZnMUrMki2oAW3FHa5omPbC4VEaMLd2HFVX81xQrpeG2GAZkvstcRdqjtxa9qVnnFKQknjCbwnDMd5G"
],
"script": "base64:AAIDAAAAAAAAAAAAAAABAQAAABJ1c2VySGFzQWRtaW5BY2Nlc3MAAAABAAAAB2FkZHJlc3MJAAAAAAAAAgUAAAAHYWRkcmVzcwUAAAAEdGhpcwAAAAIAAAABaQEAAAADYmV0AAAAAAQAAAAWc3RhcnRUcmFuc2FjdGlvbkhlaWdodAkBAAAAEUBleHRyTmF0aXZlKDEwNTApAAAAAgUAAAAEdGhpcwIAAAAFc3RhcnQEAAAACXRpbWVEZWx0YQkAAGUAAAACBQAAAAZoZWlnaHQFAAAAFnN0YXJ0VHJhbnNhY3Rpb25IZWlnaHQEAAAABm1heEJldAkBAAAAB2V4dHJhY3QAAAABCQAEGgAAAAIFAAAABHRoaXMCAAAABm1heEJldAQAAAALbWF4QmV0T3duZXIJAQAAABRhZGRyZXNzRnJvbVB1YmxpY0tleQAAAAEJAQAAAAdleHRyYWN0AAAAAQkABBwAAAACBQAAAAR0aGlzAgAAAAttYXhCZXRPd25lcgQAAAADcG10CQEAAAAHZXh0cmFjdAAAAAEIBQAAAAFpAAAAB3BheW1lbnQDCQAAZgAAAAIFAAAACXRpbWVEZ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ZtYXhCZXQFAAAACnN0YXJ0UHJpY2UJAARMAAAAAgkBAAAACURhdGFFbnRyeQAAAAICAAAAC21heEJldE93bmVyCQACWAAAAAEIBQAAAAFpAAAAD2NhbGxlclB1YmxpY0tleQUAAAADbmlsAAAAAGcwYpM=",
"chainId": 84,
"height": 580883,
"spentComplexity": 0
}
View: original | compacted
Prev: DNerT2AuGc2XTrEfb3CW1y3MXSuLvcnNxFYAgk4KxJWQ
Next: BHRWCeBQHgFEvASdvSZN6B6dTdxFiXXgL9vWfs5J3ymn
Diff:
Old | New | | Differences |
---|
5 | 5 | | |
---|
6 | 6 | | |
---|
7 | 7 | | @Callable(c) |
---|
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)) |
---|
| 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 | + | let h = extract(c.payment) |
---|
| 14 | + | if ((e > 2000)) |
---|
14 | 15 | | then throw("The betting was closed") |
---|
15 | | - | else if ((d > g)) |
---|
16 | | - | then ScriptResult(WriteSet([DataEntry("maxBet", d), DataEntry("maxBetOwner", toBase58String(c.callerPublicKey)), DataEntry(toBase58String(c.callerPublicKey), d)]), TransferSet([ScriptTransfer(this, 200, unit)])) |
---|
17 | | - | else throw("Your bet isn't the max bet") |
---|
| 16 | + | else if (!(isDefined(h.assetId))) |
---|
| 17 | + | 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)])) |
---|
| 21 | + | else throw("Your bet isn't the max bet") |
---|
| 22 | + | } |
---|
| 23 | + | else throw("You need to place a bet using waves currency") |
---|
18 | 24 | | } |
---|
19 | 25 | | |
---|
20 | 26 | | |
---|
21 | 27 | | |
---|
22 | 28 | | @Callable(c) |
---|
23 | | - | func start (i) = if (!(a(c.caller))) |
---|
| 29 | + | func start (j) = if (!(a(c.caller))) |
---|
24 | 30 | | then throw("You have no access!") |
---|
25 | | - | else WriteSet([DataEntry("start", height), DataEntry("maxBet", i), DataEntry("maxBetOwner", toBase58String(c.callerPublicKey))]) |
---|
| 31 | + | else WriteSet([DataEntry("start", height), DataEntry("maxBet", j), DataEntry("maxBetOwner", toBase58String(c.callerPublicKey))]) |
---|
26 | 32 | | |
---|
27 | 33 | | |
---|
Full:
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 (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)) |
---|
| 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 | + | let h = extract(c.payment) |
---|
| 14 | + | if ((e > 2000)) |
---|
14 | 15 | | then throw("The betting was closed") |
---|
15 | | - | else if ((d > g)) |
---|
16 | | - | then ScriptResult(WriteSet([DataEntry("maxBet", d), DataEntry("maxBetOwner", toBase58String(c.callerPublicKey)), DataEntry(toBase58String(c.callerPublicKey), d)]), TransferSet([ScriptTransfer(this, 200, unit)])) |
---|
17 | | - | else throw("Your bet isn't the max bet") |
---|
| 16 | + | else if (!(isDefined(h.assetId))) |
---|
| 17 | + | 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)])) |
---|
| 21 | + | else throw("Your bet isn't the max bet") |
---|
| 22 | + | } |
---|
| 23 | + | else throw("You need to place a bet using waves currency") |
---|
18 | 24 | | } |
---|
19 | 25 | | |
---|
20 | 26 | | |
---|
21 | 27 | | |
---|
22 | 28 | | @Callable(c) |
---|
23 | | - | func start (i) = if (!(a(c.caller))) |
---|
| 29 | + | func start (j) = if (!(a(c.caller))) |
---|
24 | 30 | | then throw("You have no access!") |
---|
25 | | - | else WriteSet([DataEntry("start", height), DataEntry("maxBet", i), DataEntry("maxBetOwner", toBase58String(c.callerPublicKey))]) |
---|
| 31 | + | else WriteSet([DataEntry("start", height), DataEntry("maxBet", j), DataEntry("maxBetOwner", toBase58String(c.callerPublicKey))]) |
---|
26 | 32 | | |
---|
27 | 33 | | |
---|