tx · j5SYJKcaTsx5Lc6m9PC9fXPCW2FkuU1zw3qLKDrhgJM 3N2icgpJnXhcYab7KQrwqWsV4LwSF25C1Ep: -0.01400000 Waves 2019.07.11 13:48 [580934] smart account 3N2icgpJnXhcYab7KQrwqWsV4LwSF25C1Ep > SELF 0.00000000 Waves
{ "type": 13, "id": "j5SYJKcaTsx5Lc6m9PC9fXPCW2FkuU1zw3qLKDrhgJM", "fee": 1400000, "feeAssetId": null, "timestamp": 1562842138778, "version": 1, "sender": "3N2icgpJnXhcYab7KQrwqWsV4LwSF25C1Ep", "senderPublicKey": "BJAeTqNbDSA5FiYihZZaSWvD6XL5XjpqVXbTGerBJjRK", "proofs": [ "4oKjGLgecmgpkW55yoezxFFPNSAcdTVGJX5g2bAoiH5yy2jhqyVTXtgjKBnBwjX6PYMvmEkWQ2vBWokWepidRoPt" ], "script": "base64:AAIDAAAAAAAAAAAAAAACAAAAAAd0b2tlbklkAQAAACCU1B7l35UfeySUCJ5Oe8nTMKHr4huFqp+vPk8CQCqTZQEAAAASdXNlckhhc0FkbWluQWNjZXNzAAAAAQAAAAdhZGRyZXNzCQAAAAAAAAIFAAAAB2FkZHJlc3MFAAAABHRoaXMAAAADAAAAAWkBAAAAA2JldAAAAAAEAAAAFnN0YXJ0VHJhbnNhY3Rpb25IZWlnaHQJAQAAABFAZXh0ck5hdGl2ZSgxMDUwKQAAAAIFAAAABHRoaXMCAAAABXN0YXJ0BAAAAAl0aW1lRGVsdGEJAABlAAAAAgUAAAAGaGVpZ2h0BQAAABZzdGFydFRyYW5zYWN0aW9uSGVpZ2h0BAAAAAZtYXhCZXQJAQAAAAdleHRyYWN0AAAAAQkABBoAAAACBQAAAAR0aGlzAgAAAAZtYXhCZXQEAAAAC21heEJldE93bmVyCQEAAAAUYWRkcmVzc0Zyb21QdWJsaWNLZXkAAAABCQABmwAAAAEJAQAAABFAZXh0ck5hdGl2ZSgxMDUzKQAAAAIFAAAABHRoaXMCAAAAC21heEJldE93bmVyBAAAA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0YXJ0BQAAAAZoZWlnaHQJAARMAAAAAgkBAAAACURhdGFFbnRyeQAAAAICAAAABm1heEJldAUAAAAKc3RhcnRQcmljZQkABEwAAAACCQEAAAAJRGF0YUVudHJ5AAAAAgIAAAALbWF4QmV0T3duZXIJAAJYAAAAAQgFAAAAAWkAAAAPY2FsbGVyUHVibGljS2V5BQAAAANuaWwAAAABaQEAAAAGZmluaXNoAAAAAAMJAQAAAAEhAAAAAQkBAAAAEnVzZXJIYXNBZG1pbkFjY2VzcwAAAAEIBQAAAAFpAAAABmNhbGxlcgkAAAIAAAABAgAAABNZb3UgaGF2ZSBubyBhY2Nlc3MhBAAAAAttYXhCZXRPd25lcgkBAAAAFGFkZHJlc3NGcm9tUHVibGljS2V5AAAAAQkAAZsAAAABCQEAAAARQGV4dHJOYXRpdmUoMTA1MykAAAACBQAAAAR0aGlzAgAAAAttYXhCZXRPd25lcgkBAAAADFNjcmlwdFJlc3VsdAAAAAIJAQAAAAhXcml0ZVNldAAAAAEJAARMAAAAAgkBAAAACURhdGFFbnRyeQAAAAICAAAABXN0YXJ0AAAAAAAAAAAABQAAAANuaWwJAQAAAAtUcmFuc2ZlclNldAAAAAEJAARMAAAAAgkBAAAADlNjcmlwdFRyYW5zZmVyAAAAAwUAAAALbWF4QmV0T3duZXIAAAAAAAAAAAEFAAAAB3Rva2VuSWQFAAAAA25pbAAAAAAtiviW", "chainId": 84, "height": 580934, "spentComplexity": 0 } View: original | compacted Prev: 9gwjCMJYVeUAQ9k64jja42jBFM8mephMhApvLJ4tuqf7 Next: EYXDPZxqCwJfRiCEymYW1K43BcM3DnwrKxQymrqRPmpb Full:
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 3 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let tokenId = base58'B1xwWnBLB7z79VPr4sq1jBb5GDqs8TeT5jHojTdiwxfE' | |
5 | 5 | ||
6 | 6 | func userHasAdminAccess (address) = (address == this) | |
7 | 7 | ||
8 | 8 | ||
9 | 9 | @Callable(i) | |
10 | 10 | func bet () = { | |
11 | 11 | let startTransactionHeight = getIntegerValue(this, "start") | |
12 | 12 | let timeDelta = (height - startTransactionHeight) | |
13 | 13 | let maxBet = extract(getInteger(this, "maxBet")) | |
14 | 14 | let maxBetOwner = addressFromPublicKey(toBytes(getStringValue(this, "maxBetOwner"))) | |
15 | 15 | let pmt = extract(i.payment) | |
16 | 16 | if ((timeDelta > 2000)) | |
17 | 17 | then throw("The betting was closed") | |
18 | 18 | else if (!(isDefined(pmt.assetId))) | |
19 | 19 | then { | |
20 | 20 | let price = pmt.amount | |
21 | 21 | if ((price > maxBet)) | |
22 | 22 | then ScriptResult(WriteSet([DataEntry("maxBet", price), DataEntry("maxBetOwner", toBase58String(i.callerPublicKey)), DataEntry(toBase58String(i.callerPublicKey), price)]), TransferSet([ScriptTransfer(maxBetOwner, maxBet, unit)])) | |
23 | 23 | else throw("Your bet isn't the max bet") | |
24 | 24 | } | |
25 | 25 | else throw("You need to place a bet using waves currency") | |
26 | 26 | } | |
27 | 27 | ||
28 | 28 | ||
29 | 29 | ||
30 | 30 | @Callable(i) | |
31 | 31 | func start (startPrice) = if (!(userHasAdminAccess(i.caller))) | |
32 | 32 | then throw("You have no access!") | |
33 | 33 | else WriteSet([DataEntry("start", height), DataEntry("maxBet", startPrice), DataEntry("maxBetOwner", toBase58String(i.callerPublicKey))]) | |
34 | 34 | ||
35 | 35 | ||
36 | 36 | ||
37 | 37 | @Callable(i) | |
38 | 38 | func finish () = if (!(userHasAdminAccess(i.caller))) | |
39 | 39 | then throw("You have no access!") | |
40 | 40 | else { | |
41 | 41 | let maxBetOwner = addressFromPublicKey(toBytes(getStringValue(this, "maxBetOwner"))) | |
42 | 42 | ScriptResult(WriteSet([DataEntry("start", 0)]), TransferSet([ScriptTransfer(maxBetOwner, 1, tokenId)])) | |
43 | 43 | } | |
44 | 44 | ||
45 | 45 |
github/deemru/w8io/169f3d6 37.78 ms ◑