tx · DNxHiAZgWnPShf9HxWVb42v4JxTTk2kjD4Rx7R9zHc32 3N2icgpJnXhcYab7KQrwqWsV4LwSF25C1Ep: -0.01400000 Waves 2019.07.12 13:20 [582379] smart account 3N2icgpJnXhcYab7KQrwqWsV4LwSF25C1Ep > SELF 0.00000000 Waves
{ "type": 13, "id": "DNxHiAZgWnPShf9HxWVb42v4JxTTk2kjD4Rx7R9zHc32", "fee": 1400000, "feeAssetId": null, "timestamp": 1562926864923, "version": 1, "sender": "3N2icgpJnXhcYab7KQrwqWsV4LwSF25C1Ep", "senderPublicKey": "BJAeTqNbDSA5FiYihZZaSWvD6XL5XjpqVXbTGerBJjRK", "proofs": [ "2FX4LsvPGweQgDkYQxfwcn9hzT9t7zxFz7McrPJUFNgy7RgG6yfuwM9zJeM1WbbPWVsNwz8JrmSz3yh56i1L9dw7" ], "script": "base64:AAIDAAAAAAAAAAAAAAADAAAAAAd0b2tlbklkAQAAACCU1B7l35UfeySUCJ5Oe8nTMKHr4huFqp+vPk8CQCqTZQEAAAASdXNlckhhc0FkbWluQWNjZXNzAAAAAQAAAAdhZGRyZXNzCQAAAAAAAAIFAAAAB2FkZHJlc3MFAAAABHRoaXMBAAAABGFkZHIAAAACAAAAB3Rva2VuSWQAAAADcGFyCQABLAAAAAIJAAEsAAAAAgkAAlgAAAABBQAAAAd0b2tlbklkAgAAAAFfBQAAAANwYXIAAAADAAAAAWkBAAAAA2JldAAAAAEAAAAHdG9rZW5JZAQAAAAWc3RhcnRUcmFuc2FjdGlvbkhlaWdodAkBAAAAEUBleHRyTmF0aXZlKDEwNTApAAAAAgUAAAAEdGhpcwkBAAAABGFkZHIAAAACBQAAAAd0b2tlbklkAgAAAAVzdGFydAQAAAAJdGltZURlbHRhCQAAZQAAAAIFAAAABmhlaWdodAUAAAAWc3RhcnRUcmFuc2FjdGlvbkhlaWdodAQAAAAGbWF4QmV0CQEAAAAHZXh0cmFjdAAAAAEJAAQaAAAAAgUAAAAEdGhpcwkBAAAABGFk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0AAAAAQkABEwAAAACCQEAAAAOU2NyaXB0VHJhbnNmZXIAAAADBQAAAAttYXhCZXRPd25lcgAAAAAAAAAAAQUAAAAHdG9rZW5JZAUAAAADbmlsAAAAAAmphU4=", "chainId": 84, "height": 582379, "spentComplexity": 0 } View: original | compacted Prev: 2hkt5YDQnm7DjKPLBFCJFf2CARsRuki8zYJVXrdYFDEi Next: HLtoeCh1a4TuNJK3rBivPnFQXp2crYMube1Em5z4g2WY Diff:
Old | New | Differences | |
---|---|---|---|
16 | 16 | let maxBet = extract(getInteger(this, addr(tokenId, "maxBet"))) | |
17 | 17 | let maxBetOwner = addressFromPublicKey(toBytes(getStringValue(this, addr(tokenId, "maxBetOwner")))) | |
18 | 18 | let pmt = extract(i.payment) | |
19 | - | throw("ok2") | |
19 | + | if ((timeDelta > 2000)) | |
20 | + | then throw("The betting was closed") | |
21 | + | else if (!(isDefined(pmt.assetId))) | |
22 | + | then throw("ok3") | |
23 | + | else throw("You need to place a bet using waves currency") | |
20 | 24 | } | |
21 | 25 | ||
22 | 26 |
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 | func addr (tokenId,par) = ((toBase58String(tokenId) + "_") + par) | |
10 | 10 | ||
11 | 11 | ||
12 | 12 | @Callable(i) | |
13 | 13 | func bet (tokenId) = { | |
14 | 14 | let startTransactionHeight = getIntegerValue(this, addr(tokenId, "start")) | |
15 | 15 | let timeDelta = (height - startTransactionHeight) | |
16 | 16 | let maxBet = extract(getInteger(this, addr(tokenId, "maxBet"))) | |
17 | 17 | let maxBetOwner = addressFromPublicKey(toBytes(getStringValue(this, addr(tokenId, "maxBetOwner")))) | |
18 | 18 | let pmt = extract(i.payment) | |
19 | - | throw("ok2") | |
19 | + | if ((timeDelta > 2000)) | |
20 | + | then throw("The betting was closed") | |
21 | + | else if (!(isDefined(pmt.assetId))) | |
22 | + | then throw("ok3") | |
23 | + | else throw("You need to place a bet using waves currency") | |
20 | 24 | } | |
21 | 25 | ||
22 | 26 | ||
23 | 27 | ||
24 | 28 | @Callable(i) | |
25 | 29 | func start (startPrice,auctionDuration) = { | |
26 | 30 | let pmt = extract(i.payment) | |
27 | 31 | let tokenIn = pmt.assetId | |
28 | 32 | if (isDefined(tokenId)) | |
29 | 33 | then WriteSet([DataEntry(addr(tokenId, "start"), height), DataEntry(addr(tokenId, "startPrice"), startPrice), DataEntry(addr(tokenId, "duration"), auctionDuration), DataEntry(addr(tokenId, "maxBetOwner"), toBase58String(i.callerPublicKey))]) | |
30 | 34 | else throw("You can't sell waves using the auction") | |
31 | 35 | } | |
32 | 36 | ||
33 | 37 | ||
34 | 38 | ||
35 | 39 | @Callable(i) | |
36 | 40 | func finish (tokenId) = { | |
37 | 41 | let length = (getIntegerValue(this, addr(tokenId, "start")) - height) | |
38 | 42 | let delta = (getIntegerValue(this, addr(tokenId, "duration")) - length) | |
39 | 43 | if ((delta > 0)) | |
40 | 44 | then throw((("The auction cannot be finished yet! " + toString(delta)) + " minutes remaining")) | |
41 | 45 | else { | |
42 | 46 | let maxBetOwner = addressFromPublicKey(toBytes(getStringValue(this, addr(tokenId, "maxBetOwner")))) | |
43 | 47 | ScriptResult(WriteSet([DataEntry(addr(tokenId, "start"), 0)]), TransferSet([ScriptTransfer(maxBetOwner, 1, tokenId)])) | |
44 | 48 | } | |
45 | 49 | } | |
46 | 50 | ||
47 | 51 |
github/deemru/w8io/169f3d6 37.82 ms ◑