tx · G495Ly92r4PnPRqXWGh5HhCvbTYewwAePvz3tNscbc7r 3MtVYGt1cJJB8g21cvSzJScK3hxUi9JHdcN: -0.01400000 Waves 2021.12.23 12:49 [1846743] smart account 3MtVYGt1cJJB8g21cvSzJScK3hxUi9JHdcN > SELF 0.00000000 Waves
{ "type": 13, "id": "G495Ly92r4PnPRqXWGh5HhCvbTYewwAePvz3tNscbc7r", "fee": 1400000, "feeAssetId": null, "timestamp": 1640252950511, "version": 2, "chainId": 84, "sender": "3MtVYGt1cJJB8g21cvSzJScK3hxUi9JHdcN", "senderPublicKey": "65qdY9G3EVQgF1GhvrT6rw2zPmUsFirt9Kjm5q5fdJvu", "proofs": [ "4o5a4mEHJP4PyA6fPd7fGZkRQyRByw4pz2cCYUqtV91iaZtXt6Gd11kCdieCLMCxSxgvNkwZa49ejRhkWf7PGWE7" ], "script": "base64:AAIFAAAAAAAAAZoIAhIGCgQBAQgIEgMKAQgaFQoBYRIQTkZUSXNzdWVyQWRkcmVzcxoPCgFiEgplZ2dBc3NldElkGhIKAWMSDXRyeUdldEludGVnZXIaCAoBZBIDa2V5GggKAWUSA3ZhbBoMCgFmEgckbWF0Y2gwGgYKAWcSAWIaEgoBaBINdHJ5R2V0Qm9vbGVhbhoVCgFpEhBnZXRBc3NldEdlbm90eXBlGgwKAWoSB2Fzc2V0SWQaBgoBaxIBaRoPCgFsEgpzdGFydFByaWNlGhEKAW0SDGluc3RhbnRQcmljZRoQCgFuEgtkZXNjcmlwdGlvbhoMCgFvEgdlZ2dTZWxsGg4KAXASCWF1Y3Rpb25JZBoICgFxEgNwbXQaCgoBchIFYXNzZXQaDgoBcxIJaXNFZ2dTZWxsGhMKAXQSDnBheW1lbnRBc3NldElkGhUKAXUSEHBheW1lbnRBc3NldE5hbWUaCwoBdhIGYW1vdW50GgoKAXcSBWJpZElkGg0KAXgSCG1pblByaWNlGgcKAXkSAnR4GgsKAXoSBnZlcmlmeQAAAAUAAAAAAWEBAAAAGgFU0t1kJimk0Q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5nRW50cnkAAAACCQABLAAAAAIJAAEsAAAAAgkAASwAAAACCQABLAAAAAICAAAACGF1Y3Rpb25fBQAAAAFwAgAAAAVfYmlkXwUAAAABdwIAAAAHX3N0YXR1cwIAAAAEb3BlbgUAAAADbmlsAAAAAQAAAAF5AQAAAAF6AAAAAAkAAfQAAAADCAUAAAABeQAAAAlib2R5Qnl0ZXMJAAGRAAAAAggFAAAAAXkAAAAGcHJvb2ZzAAAAAAAAAAAACAUAAAABeQAAAA9zZW5kZXJQdWJsaWNLZXmg23ul", "height": 1846743, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: C9bYyTpag8remkfU4bhBbXWThdpduKHrJDA2zcCDDerV Next: 2iFt5Msdd8sjfZ3TgvBbZtwjgt3rYZ6cCvTRDgBoQyKc Diff:
Old | New | Differences | |
---|---|---|---|
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let NFTIssuerAddress = base58'3N992tjd7EWM6dSHrdVjjjuJrLD4koNztZ9' | |
5 | 5 | ||
6 | - | let eggAssetId = base58' | |
6 | + | let eggAssetId = base58'2cf6jyVG19oHU79R8iHfqFEesjstr3e7nSYEUhb2WagB' | |
7 | 7 | ||
8 | 8 | func tryGetInteger (key) = { | |
9 | 9 | let val = match getInteger(this, key) { |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 5 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let NFTIssuerAddress = base58'3N992tjd7EWM6dSHrdVjjjuJrLD4koNztZ9' | |
5 | 5 | ||
6 | - | let eggAssetId = base58' | |
6 | + | let eggAssetId = base58'2cf6jyVG19oHU79R8iHfqFEesjstr3e7nSYEUhb2WagB' | |
7 | 7 | ||
8 | 8 | func tryGetInteger (key) = { | |
9 | 9 | let val = match getInteger(this, key) { | |
10 | 10 | case b: Int => | |
11 | 11 | b | |
12 | 12 | case _ => | |
13 | 13 | 0 | |
14 | 14 | } | |
15 | 15 | val | |
16 | 16 | } | |
17 | 17 | ||
18 | 18 | ||
19 | 19 | func tryGetBoolean (key) = match getBoolean(this, key) { | |
20 | 20 | case b: Boolean => | |
21 | 21 | b | |
22 | 22 | case _ => | |
23 | 23 | false | |
24 | 24 | } | |
25 | 25 | ||
26 | 26 | ||
27 | 27 | func getAssetGenotype (assetId) = if ((value(assetInfo(assetId)).issuer == Address(NFTIssuerAddress))) | |
28 | 28 | then "ART" | |
29 | 29 | else "" | |
30 | 30 | ||
31 | 31 | ||
32 | 32 | @Callable(i) | |
33 | 33 | func initAuction (startPrice,instantPrice,description,eggSell) = { | |
34 | 34 | let auctionId = toBase58String(i.transactionId) | |
35 | 35 | let pmt = value(i.payments[0]) | |
36 | 36 | let assetId = value(pmt.assetId) | |
37 | 37 | let asset = getAssetGenotype(assetId) | |
38 | 38 | if ((asset == "")) | |
39 | 39 | then throw("You can only sell an NFT-duck created in incubator or breeder") | |
40 | 40 | else [StringEntry((("auction_" + auctionId) + "_status"), "open"), BooleanEntry((("auction_" + auctionId) + "_eggSell"), (eggSell == "true")), StringEntry((("auction_" + toBase58String(assetId)) + "_last"), auctionId), StringEntry((("auction_" + auctionId) + "_assetGen"), asset), StringEntry((("auction_" + auctionId) + "_assetId"), toBase58String(assetId)), IntegerEntry((("auction_" + auctionId) + "_startedAt"), lastBlock.timestamp), StringEntry((("auction_" + auctionId) + "_owner"), toString(i.originCaller)), StringEntry((("auction_" + auctionId) + "_description"), description), IntegerEntry((("auction_" + auctionId) + "_startPrice"), startPrice), BooleanEntry((("auction_" + auctionId) + "_isArtefact"), (value(assetInfo(assetId)).issuer == Address(NFTIssuerAddress))), IntegerEntry((("auction_" + auctionId) + "_instantPrice"), instantPrice), StringEntry((((("address_" + toString(i.originCaller)) + "_auction_") + auctionId) + "_lockedNFT"), toBase58String(assetId))] | |
41 | 41 | } | |
42 | 42 | ||
43 | 43 | ||
44 | 44 | ||
45 | 45 | @Callable(i) | |
46 | 46 | func placeBid (auctionId) = { | |
47 | 47 | let isEggSell = tryGetBoolean((("auction_" + auctionId) + "_eggSell")) | |
48 | 48 | let paymentAssetId = if ((isEggSell == true)) | |
49 | 49 | then eggAssetId | |
50 | 50 | else unit | |
51 | 51 | let paymentAssetName = if ((isEggSell == true)) | |
52 | 52 | then "EGG" | |
53 | 53 | else "WAVES" | |
54 | 54 | let pmt = value(i.payments[0]) | |
55 | 55 | let amount = pmt.amount | |
56 | 56 | let bidId = toBase58String(i.transactionId) | |
57 | 57 | let assetId = getStringValue(this, (("auction_" + auctionId) + "_assetId")) | |
58 | 58 | if ((pmt.assetId != paymentAssetId)) | |
59 | 59 | then throw((("Auction does only support " + paymentAssetName) + " payments.")) | |
60 | 60 | else { | |
61 | 61 | let minPrice = tryGetInteger((("auction_" + auctionId) + "_startPrice")) | |
62 | 62 | if ((minPrice > amount)) | |
63 | 63 | then throw(("The minimal initial price is set as " + toString(minPrice))) | |
64 | 64 | else [StringEntry((((("auction_" + auctionId) + "_bid_") + bidId) + "_author"), toString(i.originCaller)), StringEntry((((("assetId_" + assetId) + "_bid_") + bidId) + "_data"), (((((("{\"auctionId\": \"" + auctionId) + "\", \"author\": \"") + toString(i.originCaller)) + "\", \"amount\": \"") + toString(amount)) + "\", \"status\": \"open\"}")), IntegerEntry((((("auction_" + auctionId) + "_bid_") + bidId) + "_amount"), amount), StringEntry(((((("address_" + toString(i.originCaller)) + "_auction_") + auctionId) + "_bid_") + bidId), assetId), StringEntry((((("auction_" + auctionId) + "_bid_") + bidId) + "_status"), "open")] | |
65 | 65 | } | |
66 | 66 | } | |
67 | 67 | ||
68 | 68 | ||
69 | 69 | @Verifier(tx) | |
70 | 70 | func verify () = sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) | |
71 | 71 |
github/deemru/w8io/03bedc9 29.42 ms ◑![]()