tx · A8bNzr9FPNdNYqfsPCB55Crq8CD1W83knYwktyjJwMDe 3N2icgpJnXhcYab7KQrwqWsV4LwSF25C1Ep: -0.01400000 Waves 2019.07.12 13:16 [582372] smart account 3N2icgpJnXhcYab7KQrwqWsV4LwSF25C1Ep > SELF 0.00000000 Waves
{ "type": 13, "id": "A8bNzr9FPNdNYqfsPCB55Crq8CD1W83knYwktyjJwMDe", "fee": 1400000, "feeAssetId": null, "timestamp": 1562926568910, "version": 1, "sender": "3N2icgpJnXhcYab7KQrwqWsV4LwSF25C1Ep", "senderPublicKey": "BJAeTqNbDSA5FiYihZZaSWvD6XL5XjpqVXbTGerBJjRK", "proofs": [ "59qTqjrsfE3T8im9kPEVwGw4H2xyohnUcrwRTp7QGvB59Kn3hjAeRAz8zHhrRn6sTpkk4KqFHa72DqkUfofXmSTT" ], "script": "base64:AAIDAAAAAAAAAAAAAAADAAAAAAd0b2tlbklkAQAAACCU1B7l35UfeySUCJ5Oe8nTMKHr4huFqp+vPk8CQCqTZQEAAAASdXNlckhhc0FkbWluQWNjZXNzAAAAAQAAAAdhZGRyZXNzCQAAAAAAAAIFAAAAB2FkZHJlc3MFAAAABHRoaXMBAAAABGFkZHIAAAACAAAAB3Rva2VuSWQAAAADcGFyCQABLAAAAAIJAAEsAAAAAgkAAlgAAAABBQAAAAd0b2tlbklkAgAAAAFfBQAAAANwYXIAAAADAAAAAWkBAAAAA2JldAAAAAEAAAAHdG9rZW5JZAQAAAAWc3RhcnRUcmFuc2FjdGlvbkhlaWdodAkBAAAAEUBleHRyTmF0aXZlKDEwNTApAAAAAgUAAAAEdGhpcwkBAAAABGFkZHIAAAACBQAAAAd0b2tlbklkAgAAAAVzdGFydAQAAAAJdGltZURlbHRhCQAAZQAAAAIFAAAABmhlaWdodAUAAAAWc3RhcnRUcmFuc2FjdGlvbkhlaWdodAQAAAAGbWF4QmV0CQEAAAAHZXh0cmFjdAAAAAEJAAQaAAAAAgUAAAAEdGhpcwkBAAAABGFkZHIAAA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AEdGhpcwkBAAAABGFkZHIAAAACBQAAAAd0b2tlbklkAgAAAAhkdXJhdGlvbgUAAAAGbGVuZ3RoAwkAAGYAAAACBQAAAAVkZWx0YQAAAAAAAAAAAAkAAAIAAAABCQABLAAAAAIJAAEsAAAAAgIAAAAkVGhlIGF1Y3Rpb24gY2Fubm90IGJlIGZpbmlzaGVkIHlldCEgCQABpAAAAAEFAAAABWRlbHRhAgAAABIgbWludXRlcyByZW1haW5pbmcEAAAAC21heEJldE93bmVyCQEAAAAUYWRkcmVzc0Zyb21QdWJsaWNLZXkAAAABCQABmwAAAAEJAQAAABFAZXh0ck5hdGl2ZSgxMDUzKQAAAAIFAAAABHRoaXMJAQAAAARhZGRyAAAAAgUAAAAHdG9rZW5JZAIAAAALbWF4QmV0T3duZXIJAQAAAAxTY3JpcHRSZXN1bHQAAAACCQEAAAAIV3JpdGVTZXQAAAABCQAETAAAAAIJAQAAAAlEYXRhRW50cnkAAAACCQEAAAAEYWRkcgAAAAIFAAAAB3Rva2VuSWQCAAAABXN0YXJ0AAAAAAAAAAAABQAAAANuaWwJAQAAAAtUcmFuc2ZlclNldAAAAAEJAARMAAAAAgkBAAAADlNjcmlwdFRyYW5zZmVyAAAAAwUAAAALbWF4QmV0T3duZXIAAAAAAAAAAAEFAAAAB3Rva2VuSWQFAAAAA25pbAAAAADsPlYL", "chainId": 84, "height": 582372, "spentComplexity": 0 } View: original | compacted Prev: EYXDPZxqCwJfRiCEymYW1K43BcM3DnwrKxQymrqRPmpb Next: 6yAxRLVbsBLPffrkgfQy31PsxXFN8ZSgkdsXmWxX41Bd Diff:
Old | New | Differences | |
---|---|---|---|
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 | - | let maxBetOwner = addressFromPublicKey(toBytes(getStringValue(this, addr(tokenId, "maxBetOwner")))) | |
18 | - | let pmt = extract(i.payment) | |
19 | - | if ((timeDelta > 2000)) | |
20 | - | then throw("The betting was closed") | |
21 | - | else if (!(isDefined(pmt.assetId))) | |
22 | - | then { | |
23 | - | let price = pmt.amount | |
24 | - | if ((price > maxBet)) | |
25 | - | then ScriptResult(WriteSet([DataEntry(addr(tokenId, "maxBet"), price), DataEntry(addr(tokenId, "maxBetOwner"), toBase58String(i.callerPublicKey))]), TransferSet([ScriptTransfer(maxBetOwner, maxBet, unit)])) | |
26 | - | else throw("Your bet isn't the max bet") | |
27 | - | } | |
28 | - | else throw("You need to place a bet using waves currency") | |
17 | + | throw("ok1") | |
29 | 18 | } | |
30 | 19 | ||
31 | 20 |
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 | - | let maxBetOwner = addressFromPublicKey(toBytes(getStringValue(this, addr(tokenId, "maxBetOwner")))) | |
18 | - | let pmt = extract(i.payment) | |
19 | - | if ((timeDelta > 2000)) | |
20 | - | then throw("The betting was closed") | |
21 | - | else if (!(isDefined(pmt.assetId))) | |
22 | - | then { | |
23 | - | let price = pmt.amount | |
24 | - | if ((price > maxBet)) | |
25 | - | then ScriptResult(WriteSet([DataEntry(addr(tokenId, "maxBet"), price), DataEntry(addr(tokenId, "maxBetOwner"), toBase58String(i.callerPublicKey))]), TransferSet([ScriptTransfer(maxBetOwner, maxBet, unit)])) | |
26 | - | else throw("Your bet isn't the max bet") | |
27 | - | } | |
28 | - | else throw("You need to place a bet using waves currency") | |
17 | + | throw("ok1") | |
29 | 18 | } | |
30 | 19 | ||
31 | 20 | ||
32 | 21 | ||
33 | 22 | @Callable(i) | |
34 | 23 | func start (startPrice,auctionDuration) = { | |
35 | 24 | let pmt = extract(i.payment) | |
36 | 25 | let tokenIn = pmt.assetId | |
37 | 26 | if (isDefined(tokenId)) | |
38 | 27 | then WriteSet([DataEntry(addr(tokenId, "start"), height), DataEntry(addr(tokenId, "startPrice"), startPrice), DataEntry(addr(tokenId, "duration"), auctionDuration), DataEntry(addr(tokenId, "maxBetOwner"), toBase58String(i.callerPublicKey))]) | |
39 | 28 | else throw("You can't sell waves using the auction") | |
40 | 29 | } | |
41 | 30 | ||
42 | 31 | ||
43 | 32 | ||
44 | 33 | @Callable(i) | |
45 | 34 | func finish (tokenId) = { | |
46 | 35 | let length = (getIntegerValue(this, addr(tokenId, "start")) - height) | |
47 | 36 | let delta = (getIntegerValue(this, addr(tokenId, "duration")) - length) | |
48 | 37 | if ((delta > 0)) | |
49 | 38 | then throw((("The auction cannot be finished yet! " + toString(delta)) + " minutes remaining")) | |
50 | 39 | else { | |
51 | 40 | let maxBetOwner = addressFromPublicKey(toBytes(getStringValue(this, addr(tokenId, "maxBetOwner")))) | |
52 | 41 | ScriptResult(WriteSet([DataEntry(addr(tokenId, "start"), 0)]), TransferSet([ScriptTransfer(maxBetOwner, 1, tokenId)])) | |
53 | 42 | } | |
54 | 43 | } | |
55 | 44 | ||
56 | 45 |
github/deemru/w8io/169f3d6 38.86 ms ◑