tx · 937rDM1R7WL7zNoS5MiChpfGuyTCri4qA1dex1AoUq7T

3N7qWoNJm2kBsZJ7N44SrccFYyVoCCu6btm:  -0.01400000 Waves

2019.07.10 17:50 [579718] smart account 3N7qWoNJm2kBsZJ7N44SrccFYyVoCCu6btm > SELF 0.00000000 Waves

{ "type": 13, "id": "937rDM1R7WL7zNoS5MiChpfGuyTCri4qA1dex1AoUq7T", "fee": 1400000, "feeAssetId": null, "timestamp": 1562770313607, "version": 1, "sender": "3N7qWoNJm2kBsZJ7N44SrccFYyVoCCu6btm", "senderPublicKey": "3nLaq8Mii8HoWP7iB5ruTcozseuC1WzQGJ9MwuX9S9EE", "proofs": [ "3zk2e6cQ25Bw9Z9dayTdxmtW2zs3QkmSXcPyXVR7ZCJKrVNStNbY3hDLphUMCHRWaCfzNyTKUMejkUZcJvPzfuy" ], "script": "base64:AAIDAAAAAAAAAAAAAAABAQAAABJ1c2VySGFzQWRtaW5BY2Nlc3MAAAABAAAAB2FkZHJlc3MJAAAAAAAAAgUAAAAHYWRkcmVzcwUAAAAEdGhpcwAAAAIAAAABaQEAAAADYmV0AAAAAAQAAAAWc3RhcnRUcmFuc2FjdGlvbkhlaWdodAkBAAAAEUBleHRyTmF0aXZlKDEwNTApAAAAAgUAAAAEdGhpcwIAAAAFc3RhcnQEAAAACXRpbWVEZWx0YQkAAGUAAAACBQAAAAZoZWlnaHQFAAAAFnN0YXJ0VHJhbnNhY3Rpb25IZWlnaHQEAAAABm1heEJldAkBAAAAB2V4dHJhY3QAAAABCQAEGgAAAAIFAAAABHRoaXMCAAAABm1heEJldAQAAAALbWF4QmV0T3duZXIJAQAAABRhZGRyZXNzRnJvbVB1YmxpY0tleQAAAAEJAQAAAAdleHRyYWN0AAAAAQkABBwAAAACBQAAAAR0aGlzAgAAAAttYXhCZXRPd25lcgMJAABmAAAAAgUAAAAJdGltZURlbHRhAAAAAAAAAAfQCQAAAgAAAAECAAAAFlRoZSBiZXR0aW5nIHdhcyBjbG9zZWQEA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ABEwAAAACCQEAAAAJRGF0YUVudHJ5AAAAAgIAAAALbWF4QmV0T3duZXIIBQAAAAFpAAAAD2NhbGxlclB1YmxpY0tleQUAAAADbmlsAAAAAKfmQ40=", "chainId": 84, "height": 579718, "spentComplexity": 0 } View: original | compacted Prev: 4be9LBzsvpUdV41yxpeU9yVfUNSDXsFQwvQKKbTh7DcF Next: none Diff:
OldNewDifferences
88 func bet () = {
99 let startTransactionHeight = getIntegerValue(this, "start")
1010 let timeDelta = (height - startTransactionHeight)
11+ let maxBet = extract(getInteger(this, "maxBet"))
12+ let maxBetOwner = addressFromPublicKey(extract(getBinary(this, "maxBetOwner")))
1113 if ((timeDelta > 2000))
1214 then throw("The betting was closed")
1315 else {
1416 let pmt = extract(i.payment)
1517 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+ then if ((pmt.amount > maxBet))
19+ then ScriptResult(WriteSet([DataEntry("maxBet", pmt.amount), DataEntry("maxBetOwner", i.callerPublicKey), DataEntry(toBase58String(i.callerPublicKey), pmt.amount)]), TransferSet([ScriptTransfer(maxBetOwner, maxBet, unit)]))
1820 else throw("Your bet isn't the max bet")
1921 else throw("You need to place a bet using waves currency")
2022 }
2527 @Callable(i)
2628 func start (startPrice) = if (!(userHasAdminAccess(i.caller)))
2729 then throw("You have no access!")
28- else WriteSet([DataEntry("start", height), DataEntry("maxBet", startPrice)])
30+ else WriteSet([DataEntry("start", height), DataEntry("maxBet", startPrice), DataEntry("maxBetOwner", i.callerPublicKey)])
2931
3032
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 3 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 func userHasAdminAccess (address) = (address == this)
55
66
77 @Callable(i)
88 func bet () = {
99 let startTransactionHeight = getIntegerValue(this, "start")
1010 let timeDelta = (height - startTransactionHeight)
11+ let maxBet = extract(getInteger(this, "maxBet"))
12+ let maxBetOwner = addressFromPublicKey(extract(getBinary(this, "maxBetOwner")))
1113 if ((timeDelta > 2000))
1214 then throw("The betting was closed")
1315 else {
1416 let pmt = extract(i.payment)
1517 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+ then if ((pmt.amount > maxBet))
19+ then ScriptResult(WriteSet([DataEntry("maxBet", pmt.amount), DataEntry("maxBetOwner", i.callerPublicKey), DataEntry(toBase58String(i.callerPublicKey), pmt.amount)]), TransferSet([ScriptTransfer(maxBetOwner, maxBet, unit)]))
1820 else throw("Your bet isn't the max bet")
1921 else throw("You need to place a bet using waves currency")
2022 }
2123 }
2224
2325
2426
2527 @Callable(i)
2628 func start (startPrice) = if (!(userHasAdminAccess(i.caller)))
2729 then throw("You have no access!")
28- else WriteSet([DataEntry("start", height), DataEntry("maxBet", startPrice)])
30+ else WriteSet([DataEntry("start", height), DataEntry("maxBet", startPrice), DataEntry("maxBetOwner", i.callerPublicKey)])
2931
3032

github/deemru/w8io/169f3d6 
39.42 ms