tx · 7eRZ3K6wYRsjaiu7NMPja13tcdQ2xosDLaT5ghMzYm2Z

3N2icgpJnXhcYab7KQrwqWsV4LwSF25C1Ep:  -0.01400000 Waves

2019.07.10 14:58 [579546] smart account 3N2icgpJnXhcYab7KQrwqWsV4LwSF25C1Ep > SELF 0.00000000 Waves

{ "type": 13, "id": "7eRZ3K6wYRsjaiu7NMPja13tcdQ2xosDLaT5ghMzYm2Z", "fee": 1400000, "feeAssetId": null, "timestamp": 1562759885678, "version": 1, "sender": "3N2icgpJnXhcYab7KQrwqWsV4LwSF25C1Ep", "senderPublicKey": "BJAeTqNbDSA5FiYihZZaSWvD6XL5XjpqVXbTGerBJjRK", "proofs": [ "42KkcHR9cA9DWU1TE1EBNt3nDFSR8oULUVjHkQiujrqKfgFJckRwbgj2dBWKWEsFYFvTtex7eMtq1ybmFBc2wb9M" ], "script": "base64:AAIDAAAAAAAAAAAAAAABAQAAABJ1c2VySGFzQWRtaW5BY2Nlc3MAAAABAAAAB2FkZHJlc3MJAAAAAAAAAgUAAAAHYWRkcmVzcwUAAAAEdGhpcwAAAAIAAAABaQEAAAADYmV0AAAAAAQAAAAWc3RhcnRUcmFuc2FjdGlvbkhlaWdodAkBAAAAEUBleHRyTmF0aXZlKDEwNTApAAAAAgUAAAAEdGhpcwIAAAAFc3RhcnQEAAAACXRpbWVEZWx0YQkAAGUAAAACBQAAAAZoZWlnaHQFAAAAFnN0YXJ0VHJhbnNhY3Rpb25IZWlnaHQDCQAAZgAAAAIFAAAACXRpbWVEZWx0YQAAAAAAAAAH0AkAAAIAAAABAgAAABZUaGUgYmV0dGluZyB3YXMgY2xvc2VkBAAAAANwbXQJAQAAAAdleHRyYWN0AAAAAQgFAAAAAWkAAAAHcGF5bWVudAMJAQAAAAlpc0RlZmluZWQAAAABCAUAAAADcG10AAAAB2Fzc2V0SWQDCQAAZgAAAAIIBQAAAANwbXQAAAAGYW1vdW50CQEAAAAHZXh0cmFjdAAAAAEJAAQaAAAAAgUAAAAEdGhpcwIAAAAGbWF4QmV0CQEAAAAIV3JpdGVTZXQAAAABCQAETAAAAAIJAQAAAAlEYXRhRW50cnkAAAACAgAAAAZtYXhCZXQIBQAAAANwbXQAAAAGYW1vdW50CQAETAAAAAIJAQAAAAlEYXRhRW50cnkAAAACCQACWAAAAAEIBQAAAAFpAAAAD2NhbGxlclB1YmxpY0tleQgFAAAAA3BtdAAAAAZhbW91bnQFAAAAA25pbAkAAAIAAAABAgAAABpZb3VyIGJldCBpc24ndCB0aGUgbWF4IGJldAkAAAIAAAABAgAAACxZb3UgbmVlZCB0byBwbGFjZSBhIGJldCB1c2luZyB3YXZlcyBjdXJyZW5jeQAAAAFpAQAAAAVzdGFydAAAAAEAAAAKc3RhcnRQcmljZQMJAQAAAAEhAAAAAQkBAAAAEnVzZXJIYXNBZG1pbkFjY2VzcwAAAAEIBQAAAAFpAAAABmNhbGxlcgkAAAIAAAABAgAAABNZb3UgaGF2ZSBubyBhY2Nlc3MhCQEAAAAIV3JpdGVTZXQAAAABCQAETAAAAAIJAQAAAAlEYXRhRW50cnkAAAACAgAAAAVzdGFydAUAAAAGaGVpZ2h0CQAETAAAAAIJAQAAAAlEYXRhRW50cnkAAAACAgAAAAZtYXhCZXQFAAAACnN0YXJ0UHJpY2UFAAAAA25pbAAAAABuzg+c", "chainId": 84, "height": 579546, "spentComplexity": 0 } View: original | compacted Prev: BxQC9RDUncNtfaCs7A95Y321oDSNsK1ceThGC6gpg9ds Next: BwmqPTVoxR4ZWRX3oYWdtZA5owPU3JcNHd6goNZ3p7sg Full:
OldNewDifferences
11 {-# STDLIB_VERSION 3 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
4-func userHasAdminAccess (userPublicKey) = {
5- let adminPubKey = base58'BJAeTqNbDSA5FiYihZZaSWvD6XL5XjpqVXbTGerBJjRK'
6- (userPublicKey != adminPubKey)
7- }
4+func userHasAdminAccess (address) = (address == this)
85
96
107 @Callable(i)
11-func bet (price) = {
8+func bet () = {
129 let startTransactionHeight = getIntegerValue(this, "start")
1310 let timeDelta = (height - startTransactionHeight)
1411 if ((timeDelta > 2000))
1512 then throw("The betting was closed")
16- else WriteSet([DataEntry(toBase58String(i.callerPublicKey), price)])
13+ else {
14+ let pmt = extract(i.payment)
15+ if (isDefined(pmt.assetId))
16+ then if ((pmt.amount > extract(getInteger(this, "maxBet"))))
17+ then WriteSet([DataEntry("maxBet", pmt.amount), DataEntry(toBase58String(i.callerPublicKey), pmt.amount)])
18+ else throw("Your bet isn't the max bet")
19+ else throw("You need to place a bet using waves currency")
20+ }
1721 }
1822
1923
2024
2125 @Callable(i)
22-func start () = if (!(userHasAdminAccess(i.callerPublicKey)))
26+func start (startPrice) = if (!(userHasAdminAccess(i.caller)))
2327 then throw("You have no access!")
24- else WriteSet([DataEntry("start", height)])
28+ else WriteSet([DataEntry("start", height), DataEntry("maxBet", startPrice)])
2529
2630

github/deemru/w8io/169f3d6 
60.34 ms