tx · 4be9LBzsvpUdV41yxpeU9yVfUNSDXsFQwvQKKbTh7DcF 3N7qWoNJm2kBsZJ7N44SrccFYyVoCCu6btm: -0.01400000 Waves 2019.07.10 17:19 [579683] smart account 3N7qWoNJm2kBsZJ7N44SrccFYyVoCCu6btm > SELF 0.00000000 Waves
{ "type": 13, "id": "4be9LBzsvpUdV41yxpeU9yVfUNSDXsFQwvQKKbTh7DcF", "fee": 1400000, "feeAssetId": null, "timestamp": 1562768410167, "version": 1, "sender": "3N7qWoNJm2kBsZJ7N44SrccFYyVoCCu6btm", "senderPublicKey": "3nLaq8Mii8HoWP7iB5ruTcozseuC1WzQGJ9MwuX9S9EE", "proofs": [ "5veuE3rAvYVmuj4AhVwGQ12nbGhExjCcxWwfHP5GLux9n9vKLdMaVmc4EQqQrPp7knQfz1vA7wnL6exU5oWe15cW" ], "script": "base64:AAIDAAAAAAAAAAAAAAABAQAAABJ1c2VySGFzQWRtaW5BY2Nlc3MAAAABAAAAB2FkZHJlc3MJAAAAAAAAAgUAAAAHYWRkcmVzcwUAAAAEdGhpcwAAAAIAAAABaQEAAAADYmV0AAAAAAQAAAAWc3RhcnRUcmFuc2FjdGlvbkhlaWdodAkBAAAAEUBleHRyTmF0aXZlKDEwNTApAAAAAgUAAAAEdGhpcwIAAAAFc3RhcnQEAAAACXRpbWVEZWx0YQkAAGUAAAACBQAAAAZoZWlnaHQFAAAAFnN0YXJ0VHJhbnNhY3Rpb25IZWlnaHQDCQAAZgAAAAIFAAAACXRpbWVEZWx0YQAAAAAAAAAH0AkAAAIAAAABAgAAABZUaGUgYmV0dGluZyB3YXMgY2xvc2VkBAAAAANwbXQJAQAAAAdleHRyYWN0AAAAAQgFAAAAAWkAAAAHcGF5bWVudAMJAQAAAAEhAAAAAQkBAAAACWlzRGVmaW5lZAAAAAEIBQAAAANwbXQAAAAHYXNzZXRJZAMJAABmAAAAAggFAAAAA3BtdAAAAAZhbW91bnQJAQAAAAdleHRyYWN0AAAAAQkABBoAAAACBQAAAAR0aGlzAgAAAAZtYXhCZXQJAQAAAAhXcml0ZVNldAAAAAEJAARMAAAAAgkBAAAACURhdGFFbnRyeQAAAAICAAAABm1heEJldAgFAAAAA3BtdAAAAAZhbW91bnQJAARMAAAAAgkBAAAACURhdGFFbnRyeQAAAAIJAAJYAAAAAQgFAAAAAWkAAAAPY2FsbGVyUHVibGljS2V5CAUAAAADcG10AAAABmFtb3VudAUAAAADbmlsCQAAAgAAAAECAAAAGllvdXIgYmV0IGlzbid0IHRoZSBtYXggYmV0CQAAAgAAAAECAAAALFlvdSBuZWVkIHRvIHBsYWNlIGEgYmV0IHVzaW5nIHdhdmVzIGN1cnJlbmN5AAAAAWkBAAAABXN0YXJ0AAAAAQAAAApzdGFydFByaWNlAwkBAAAAASEAAAABCQEAAAASdXNlckhhc0FkbWluQWNjZXNzAAAAAQgFAAAAAWkAAAAGY2FsbGVyCQAAAgAAAAECAAAAE1lvdSBoYXZlIG5vIGFjY2VzcyEJAQAAAAhXcml0ZVNldAAAAAEJAARMAAAAAgkBAAAACURhdGFFbnRyeQAAAAICAAAABXN0YXJ0BQAAAAZoZWlnaHQJAARMAAAAAgkBAAAACURhdGFFbnRyeQAAAAICAAAABm1heEJldAUAAAAKc3RhcnRQcmljZQUAAAADbmlsAAAAAHuh+40=", "chainId": 84, "height": 579683, "spentComplexity": 0 } View: original | compacted Prev: 5AnKvb3kHawxkQjwUctbAQksTUDaKzdiWsB2uJWcG9HX Next: 937rDM1R7WL7zNoS5MiChpfGuyTCri4qA1dex1AoUq7T Full:
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 3 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | - | func voterIsAllowedToVote (voterPublicKey) = { | |
5 | - | let alekseiPubKey = base58'3nLaq8Mii8HoWP7iB5ruTcozseuC1WzQGJ9MwuX9S9EE' | |
6 | - | let mariaPubKey = base58'FVdZkk3zdsLbAu9BG5Ma671jkPPCW1Jp3F1fUz339pQW' | |
7 | - | if (if ((voterPublicKey != alekseiPubKey)) | |
8 | - | then (voterPublicKey != mariaPubKey) | |
9 | - | else false) | |
10 | - | then false | |
11 | - | else true | |
4 | + | func userHasAdminAccess (address) = (address == this) | |
5 | + | ||
6 | + | ||
7 | + | @Callable(i) | |
8 | + | func bet () = { | |
9 | + | let startTransactionHeight = getIntegerValue(this, "start") | |
10 | + | let timeDelta = (height - startTransactionHeight) | |
11 | + | if ((timeDelta > 2000)) | |
12 | + | then throw("The betting was closed") | |
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 | + | } | |
12 | 21 | } | |
13 | 22 | ||
14 | 23 | ||
24 | + | ||
15 | 25 | @Callable(i) | |
16 | - | func vote (theVote) = if (!(voterIsAllowedToVote(i.callerPublicKey))) | |
17 | - | then throw("You can not vote because you are not in the list of voters!") | |
18 | - | else { | |
19 | - | let dataFromStorage = getInteger(this, toBase58String(i.callerPublicKey)) | |
20 | - | WriteSet([DataEntry(toBase58String(i.callerPublicKey), theVote)]) | |
21 | - | } | |
26 | + | func start (startPrice) = if (!(userHasAdminAccess(i.caller))) | |
27 | + | then throw("You have no access!") | |
28 | + | else WriteSet([DataEntry("start", height), DataEntry("maxBet", startPrice)]) | |
22 | 29 | ||
23 | 30 |
github/deemru/w8io/169f3d6 33.01 ms ◑