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