tx · 8BVesQFnay93umwhLmCvdy1bjerAMTBbDBHpZ5gjNxvT
3N2icgpJnXhcYab7KQrwqWsV4LwSF25C1Ep: -0.01400000 Waves
2019.07.11 12:34 [580859] smart account 3N2icgpJnXhcYab7KQrwqWsV4LwSF25C1Ep > SELF 0.00000000 Waves
{
"type": 13,
"id": "8BVesQFnay93umwhLmCvdy1bjerAMTBbDBHpZ5gjNxvT",
"fee": 1400000,
"feeAssetId": null,
"timestamp": 1562837736733,
"version": 1,
"sender": "3N2icgpJnXhcYab7KQrwqWsV4LwSF25C1Ep",
"senderPublicKey": "BJAeTqNbDSA5FiYihZZaSWvD6XL5XjpqVXbTGerBJjRK",
"proofs": [
"47q1vaAdUF4J8HE4MzJ1mBFozJRfZg8iTJ39yUZz25XH1SHRM4RjH6NEe4pfYdZDLw7S9ZXgWkdEnFBPDs1Mh4Em"
],
"script": "base64:AAIDAAAAAAAAAAAAAAABAQAAABJ1c2VySGFzQWRtaW5BY2Nlc3MAAAABAAAAB2FkZHJlc3MJAAAAAAAAAgUAAAAHYWRkcmVzcwUAAAAEdGhpcwAAAAIAAAABaQEAAAADYmV0AAAAAQAAAAVwcmljZQQAAAAWc3RhcnRUcmFuc2FjdGlvbkhlaWdodAkBAAAAEUBleHRyTmF0aXZlKDEwNTApAAAAAgUAAAAEdGhpcwIAAAAFc3RhcnQEAAAACXRpbWVEZWx0YQkAAGUAAAACBQAAAAZoZWlnaHQFAAAAFnN0YXJ0VHJhbnNhY3Rpb25IZWlnaHQEAAAABm1heEJldAkBAAAAB2V4dHJhY3QAAAABCQAEGgAAAAIFAAAABHRoaXMCAAAABm1heEJldAQAAAALbWF4QmV0T3duZXIJAQAAABRhZGRyZXNzRnJvbVB1YmxpY0tleQAAAAEJAQAAAAdleHRyYWN0AAAAAQkABBwAAAACBQAAAAR0aGlzAgAAAAttYXhCZXRPd25lcgMJAABmAAAAAgUAAAAJdGltZURlbHRhAAAAAAAAAAfQCQAAAgAAAAECAAAAFlRoZSBiZXR0aW5nIHdhcyBjbG9zZWQDCQAAZgAAAAIFAAAABXByaWNlBQAAAAZtYXhCZXQJAAACAAAAAQIAAAAGaGVyZSA0CQAAAgAAAAECAAAAGllvdXIgYmV0IGlzbid0IHRoZSBtYXggYmV0AAAAAWkBAAAABXN0YXJ0AAAAAQAAAApzdGFydFByaWNlAwkBAAAAASEAAAABCQEAAAASdXNlckhhc0FkbWluQWNjZXNzAAAAAQgFAAAAAWkAAAAGY2FsbGVyCQAAAgAAAAECAAAAE1lvdSBoYXZlIG5vIGFjY2VzcyEJAQAAAAhXcml0ZVNldAAAAAEJAARMAAAAAgkBAAAACURhdGFFbnRyeQAAAAICAAAABXN0YXJ0BQAAAAZoZWlnaHQJAARMAAAAAgkBAAAACURhdGFFbnRyeQAAAAICAAAABm1heEJldAUAAAAKc3RhcnRQcmljZQkABEwAAAACCQEAAAAJRGF0YUVudHJ5AAAAAgIAAAALbWF4QmV0T3duZXIJAAJYAAAAAQgFAAAAAWkAAAAPY2FsbGVyUHVibGljS2V5BQAAAANuaWwAAAAA5GZeWQ==",
"chainId": 84,
"height": 580859,
"spentComplexity": 0
}
View: original | compacted
Prev: 9g46q4D4aYAQbTgQsxiGxPaYsUuyEvjPTkeJ5CgVsSqA
Next: 6CjiydNSuEsFjYizWR3t1XSLRjvJq5KhUREiYcBSxHb2
Diff:
Old | New | | Differences |
---|
10 | 10 | | let timeDelta = (height - startTransactionHeight) |
---|
11 | 11 | | let maxBet = extract(getInteger(this, "maxBet")) |
---|
12 | 12 | | let maxBetOwner = addressFromPublicKey(extract(getBinary(this, "maxBetOwner"))) |
---|
13 | | - | throw("here 3") |
---|
| 13 | + | if ((timeDelta > 2000)) |
---|
| 14 | + | then throw("The betting was closed") |
---|
| 15 | + | else if ((price > maxBet)) |
---|
| 16 | + | then throw("here 4") |
---|
| 17 | + | else throw("Your bet isn't the max bet") |
---|
14 | 18 | | } |
---|
15 | 19 | | |
---|
16 | 20 | | |
---|
Full:
Old | New | | Differences |
---|
1 | 1 | | {-# STDLIB_VERSION 3 #-} |
---|
2 | 2 | | {-# SCRIPT_TYPE ACCOUNT #-} |
---|
3 | 3 | | {-# CONTENT_TYPE DAPP #-} |
---|
4 | 4 | | func userHasAdminAccess (address) = (address == this) |
---|
5 | 5 | | |
---|
6 | 6 | | |
---|
7 | 7 | | @Callable(i) |
---|
8 | 8 | | func bet (price) = { |
---|
9 | 9 | | let startTransactionHeight = getIntegerValue(this, "start") |
---|
10 | 10 | | let timeDelta = (height - startTransactionHeight) |
---|
11 | 11 | | let maxBet = extract(getInteger(this, "maxBet")) |
---|
12 | 12 | | let maxBetOwner = addressFromPublicKey(extract(getBinary(this, "maxBetOwner"))) |
---|
13 | | - | throw("here 3") |
---|
| 13 | + | if ((timeDelta > 2000)) |
---|
| 14 | + | then throw("The betting was closed") |
---|
| 15 | + | else if ((price > maxBet)) |
---|
| 16 | + | then throw("here 4") |
---|
| 17 | + | else throw("Your bet isn't the max bet") |
---|
14 | 18 | | } |
---|
15 | 19 | | |
---|
16 | 20 | | |
---|
17 | 21 | | |
---|
18 | 22 | | @Callable(i) |
---|
19 | 23 | | func start (startPrice) = if (!(userHasAdminAccess(i.caller))) |
---|
20 | 24 | | then throw("You have no access!") |
---|
21 | 25 | | else WriteSet([DataEntry("start", height), DataEntry("maxBet", startPrice), DataEntry("maxBetOwner", toBase58String(i.callerPublicKey))]) |
---|
22 | 26 | | |
---|
23 | 27 | | |
---|