tx · BwmqPTVoxR4ZWRX3oYWdtZA5owPU3JcNHd6goNZ3p7sg
3N2icgpJnXhcYab7KQrwqWsV4LwSF25C1Ep: -0.01400000 Waves
2019.07.10 17:19 [579683] smart account 3N2icgpJnXhcYab7KQrwqWsV4LwSF25C1Ep > SELF 0.00000000 Waves
{
"type": 13,
"id": "BwmqPTVoxR4ZWRX3oYWdtZA5owPU3JcNHd6goNZ3p7sg",
"fee": 1400000,
"feeAssetId": null,
"timestamp": 1562768430287,
"version": 1,
"sender": "3N2icgpJnXhcYab7KQrwqWsV4LwSF25C1Ep",
"senderPublicKey": "BJAeTqNbDSA5FiYihZZaSWvD6XL5XjpqVXbTGerBJjRK",
"proofs": [
"mLqwqJCqAEtKWSUpiNNi4v4Za1UHxiQdSdA9CMWjGqBHtmVfJcsP9hq4SD7T9zhoQSj4Q1L8a5dfxs87P3ZWDsw"
],
"script": "base64:AAIDAAAAAAAAAAAAAAABAQAAABJ1c2VySGFzQWRtaW5BY2Nlc3MAAAABAAAAB2FkZHJlc3MJAAAAAAAAAgUAAAAHYWRkcmVzcwUAAAAEdGhpcwAAAAIAAAABaQEAAAADYmV0AAAAAAQAAAAWc3RhcnRUcmFuc2FjdGlvbkhlaWdodAkBAAAAEUBleHRyTmF0aXZlKDEwNTApAAAAAgUAAAAEdGhpcwIAAAAFc3RhcnQEAAAACXRpbWVEZWx0YQkAAGUAAAACBQAAAAZoZWlnaHQFAAAAFnN0YXJ0VHJhbnNhY3Rpb25IZWlnaHQDCQAAZgAAAAIFAAAACXRpbWVEZWx0YQAAAAAAAAAH0AkAAAIAAAABAgAAABZUaGUgYmV0dGluZyB3YXMgY2xvc2VkBAAAAANwbXQJAQAAAAdleHRyYWN0AAAAAQgFAAAAAWkAAAAHcGF5bWVudAMJAQAAAAEhAAAAAQkBAAAACWlzRGVmaW5lZAAAAAEIBQAAAANwbXQAAAAHYXNzZXRJZAMJAABmAAAAAggFAAAAA3BtdAAAAAZhbW91bnQJAQAAAAdleHRyYWN0AAAAAQkABBoAAAACBQAAAAR0aGlzAgAAAAZtYXhCZXQJAQAAAAhXcml0ZVNldAAAAAEJAARMAAAAAgkBAAAACURhdGFFbnRyeQAAAAICAAAABm1heEJldAgFAAAAA3BtdAAAAAZhbW91bnQJAARMAAAAAgkBAAAACURhdGFFbnRyeQAAAAIJAAJYAAAAAQgFAAAAAWkAAAAPY2FsbGVyUHVibGljS2V5CAUAAAADcG10AAAABmFtb3VudAUAAAADbmlsCQAAAgAAAAECAAAAGllvdXIgYmV0IGlzbid0IHRoZSBtYXggYmV0CQAAAgAAAAECAAAALFlvdSBuZWVkIHRvIHBsYWNlIGEgYmV0IHVzaW5nIHdhdmVzIGN1cnJlbmN5AAAAAWkBAAAABXN0YXJ0AAAAAQAAAApzdGFydFByaWNlAwkBAAAAASEAAAABCQEAAAASdXNlckhhc0FkbWluQWNjZXNzAAAAAQgFAAAAAWkAAAAGY2FsbGVyCQAAAgAAAAECAAAAE1lvdSBoYXZlIG5vIGFjY2VzcyEJAQAAAAhXcml0ZVNldAAAAAEJAARMAAAAAgkBAAAACURhdGFFbnRyeQAAAAICAAAABXN0YXJ0BQAAAAZoZWlnaHQJAARMAAAAAgkBAAAACURhdGFFbnRyeQAAAAICAAAABm1heEJldAUAAAAKc3RhcnRQcmljZQUAAAADbmlsAAAAAHuh+40=",
"chainId": 84,
"height": 579683,
"spentComplexity": 0
}
View: original | compacted
Prev: 7eRZ3K6wYRsjaiu7NMPja13tcdQ2xosDLaT5ghMzYm2Z
Next: G3QVVbuAVYEsHsomeSDeaMpcCiJjAH5g6RvcJzMWXDW1
Diff:
Old | New | | Differences |
---|
12 | 12 | | then throw("The betting was closed") |
---|
13 | 13 | | else { |
---|
14 | 14 | | let pmt = extract(i.payment) |
---|
15 | | - | if (isDefined(pmt.assetId)) |
---|
| 15 | + | if (!(isDefined(pmt.assetId))) |
---|
16 | 16 | | then if ((pmt.amount > extract(getInteger(this, "maxBet")))) |
---|
17 | 17 | | then WriteSet([DataEntry("maxBet", pmt.amount), DataEntry(toBase58String(i.callerPublicKey), pmt.amount)]) |
---|
18 | 18 | | else throw("Your bet isn't the max bet") |
---|
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 () = { |
---|
9 | 9 | | let startTransactionHeight = getIntegerValue(this, "start") |
---|
10 | 10 | | let timeDelta = (height - startTransactionHeight) |
---|
11 | 11 | | if ((timeDelta > 2000)) |
---|
12 | 12 | | then throw("The betting was closed") |
---|
13 | 13 | | else { |
---|
14 | 14 | | let pmt = extract(i.payment) |
---|
15 | | - | if (isDefined(pmt.assetId)) |
---|
| 15 | + | if (!(isDefined(pmt.assetId))) |
---|
16 | 16 | | then if ((pmt.amount > extract(getInteger(this, "maxBet")))) |
---|
17 | 17 | | then WriteSet([DataEntry("maxBet", pmt.amount), DataEntry(toBase58String(i.callerPublicKey), pmt.amount)]) |
---|
18 | 18 | | else throw("Your bet isn't the max bet") |
---|
19 | 19 | | else throw("You need to place a bet using waves currency") |
---|
20 | 20 | | } |
---|
21 | 21 | | } |
---|
22 | 22 | | |
---|
23 | 23 | | |
---|
24 | 24 | | |
---|
25 | 25 | | @Callable(i) |
---|
26 | 26 | | func start (startPrice) = if (!(userHasAdminAccess(i.caller))) |
---|
27 | 27 | | then throw("You have no access!") |
---|
28 | 28 | | else WriteSet([DataEntry("start", height), DataEntry("maxBet", startPrice)]) |
---|
29 | 29 | | |
---|
30 | 30 | | |
---|