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