tx · 8Sry9mhS9WQJrf7GYDh8VC1PQmu9Qgbe8696ZmN5uqT2 3My7JvybytBTv6LBND2MeZCbkeUS7jR3PiK: -0.01000000 Waves 2022.11.30 09:55 [2339522] smart account 3My7JvybytBTv6LBND2MeZCbkeUS7jR3PiK > SELF 0.00000000 Waves
{ "type": 13, "id": "8Sry9mhS9WQJrf7GYDh8VC1PQmu9Qgbe8696ZmN5uqT2", "fee": 1000000, "feeAssetId": null, "timestamp": 1669791329541, "version": 2, "chainId": 84, "sender": "3My7JvybytBTv6LBND2MeZCbkeUS7jR3PiK", "senderPublicKey": "FVTpXbDNs3kNEiYy4vjvjfzxbQim8PuN6fNLFntwM31j", "proofs": [ "33PSxMCcCMuV8gHDTYX9687UmW9keh2tKF2HHtx2nQ1xwa9m3rUaZwv6MF7uLpVSFcZ1qXp9Tp5Z2CGHxyngHz9X" ], "script": "base64:AAIDAAAAAAAAABMIARIFCgMBAQgSAwoBCBIDCgEIAAAAAQAAAAASbWF4QXVjdGlvbkR1cmF0aW9uCQAAaAAAAAIAAAAAAAAABaAAAAAAAAAAAB4AAAADAAAAAWkBAAAADHN0YXJ0QXVjdGlvbgAAAAMAAAAIZHVyYXRpb24AAAAKc3RhcnRQcmljZQAAAAxwcmljZUFzc2V0SWQEAAAACWF1Y3Rpb25JZAkAAlgAAAABCAUAAAABaQAAAA10cmFuc2FjdGlvbklkBAAAAAllbmRIZWlnaHQJAABkAAAAAggFAAAACWxhc3RCbG9jawAAAAZoZWlnaHQFAAAACGR1cmF0aW9uBAAAAANwbXQJAQAAAAdleHRyYWN0AAAAAQgFAAAAAWkAAAAHcGF5bWVudAMJAABmAAAAAgUAAAAIZHVyYXRpb24FAAAAEm1heEF1Y3Rpb25EdXJhdGlvbgkAAAIAAAABCQABLAAAAAICAAAAKER1cmF0aW9uIGlzIHRvbyBsb25nLiBNdXN0IGJlIGxlc3MgdGhhbiAJAAGkAAAAAQUAAAASbWF4QXVjdGlvbkR1cmF0aW9uCQEAAAAIV3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JBZGRyBQAAAAlsb3RBbW91bnQFAAAACGxvdEFzc2V0CQAETAAAAAIJAQAAAA5TY3JpcHRUcmFuc2ZlcgAAAAMFAAAADW9yZ2FuaXplckFkZHIFAAAACXdpbkFtb3VudAUAAAAKcHJpY2VBc3NldAUAAAADbmlsAAAAAK2i3zY=", "height": 2339522, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: GBWbwyUxXrKW5zxHZemrGAqA994sM32okAZSNjUGD2YA Next: 78yT3tvUhvACAJg9WwW399gjDTGKPEv195p45mzLSq6d Full:
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 3 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let maxAuctionDuration = (1440 * 30) | |
5 | 5 | ||
6 | 6 | @Callable(i) | |
7 | 7 | func startAuction (duration,startPrice,priceAssetId) = { | |
8 | 8 | let auctionId = toBase58String(i.transactionId) | |
9 | 9 | let endHeight = (lastBlock.height + duration) | |
10 | 10 | let pmt = extract(i.payment) | |
11 | 11 | if ((duration > maxAuctionDuration)) | |
12 | 12 | then throw(("Duration is too long. Must be less than " + toString(maxAuctionDuration))) | |
13 | 13 | else WriteSet([DataEntry(auctionId, endHeight), DataEntry((auctionId + "_organizer"), toBase58String(i.caller.bytes)), DataEntry((auctionId + "_lot_assetId"), if (isDefined(pmt.assetId)) | |
14 | 14 | then toBase58String(value(pmt.assetId)) | |
15 | 15 | else "WAVES"), DataEntry((auctionId + "_lot_amount"), pmt.amount), DataEntry((auctionId + "_startPrice"), startPrice), DataEntry((auctionId + "_priceAssetId"), priceAssetId)]) | |
16 | 16 | } | |
17 | 17 | ||
18 | 18 | ||
19 | 19 | ||
20 | 20 | @Callable(i) | |
21 | 21 | func bid (auctionId) = { | |
22 | 22 | let pmt = extract(i.payment) | |
23 | 23 | let pmtAssetIdStr = if (isDefined(pmt.assetId)) | |
24 | 24 | then toBase58String(value(pmt.assetId)) | |
25 | 25 | else "WAVES" | |
26 | 26 | let callerAddressStr = toBase58String(i.caller.bytes) | |
27 | 27 | let endHeight = getIntegerValue(this, auctionId) | |
28 | 28 | let startPrice = getIntegerValue(this, (auctionId + "_startPrice")) | |
29 | 29 | let priceAssetId = getStringValue(this, (auctionId + "_priceAssetId")) | |
30 | 30 | let winAmount = getInteger(this, (auctionId + "_winAmount")) | |
31 | 31 | let winner = getString(this, (auctionId + "_winner")) | |
32 | 32 | let bidFromTheSameUser = if (isDefined(winner)) | |
33 | 33 | then (value(winner) == callerAddressStr) | |
34 | 34 | else false | |
35 | 35 | let totalBidAmount = (pmt.amount + (if (bidFromTheSameUser) | |
36 | 36 | then value(winAmount) | |
37 | 37 | else 0)) | |
38 | 38 | if ((lastBlock.height >= endHeight)) | |
39 | 39 | then throw("Auction already finished") | |
40 | 40 | else if ((priceAssetId != pmtAssetIdStr)) | |
41 | 41 | then throw((("Bid must be in asset '" + priceAssetId) + "'")) | |
42 | 42 | else if (if (if (isDefined(winAmount)) | |
43 | 43 | then (value(winAmount) >= totalBidAmount) | |
44 | 44 | else false) | |
45 | 45 | then true | |
46 | 46 | else if (!(isDefined(winAmount))) | |
47 | 47 | then (startPrice >= totalBidAmount) | |
48 | 48 | else false) | |
49 | 49 | then throw(("Bid must be more then " + toString(if (isDefined(winAmount)) | |
50 | 50 | then value(winAmount) | |
51 | 51 | else startPrice))) | |
52 | 52 | else if (if (bidFromTheSameUser) | |
53 | 53 | then true | |
54 | 54 | else !(isDefined(winner))) | |
55 | 55 | then WriteSet([DataEntry((auctionId + "_winner"), callerAddressStr), DataEntry((auctionId + "_winAmount"), totalBidAmount)]) | |
56 | 56 | else { | |
57 | 57 | let previousBidderAddr = addressFromStringValue(value(winner)) | |
58 | 58 | let priceAsset = if (if ((priceAssetId == "WAVES")) | |
59 | 59 | then true | |
60 | 60 | else (priceAssetId == "")) | |
61 | 61 | then unit | |
62 | 62 | else fromBase58String(priceAssetId) | |
63 | 63 | ScriptResult(WriteSet([DataEntry((auctionId + "_winner"), callerAddressStr), DataEntry((auctionId + "_winAmount"), totalBidAmount)]), TransferSet([ScriptTransfer(previousBidderAddr, value(winAmount), priceAsset)])) | |
64 | 64 | } | |
65 | 65 | } | |
66 | 66 | ||
67 | 67 | ||
68 | 68 | ||
69 | 69 | @Callable(i) | |
70 | 70 | func withdraw (auctionId) = { | |
71 | 71 | let pmt = extract(i.payment) | |
72 | 72 | let pmtAssetIdStr = if (isDefined(pmt.assetId)) | |
73 | 73 | then toBase58String(value(pmt.assetId)) | |
74 | 74 | else "WAVES" | |
75 | 75 | let callerAddressStr = toBase58String(i.caller.bytes) | |
76 | 76 | let endHeight = getIntegerValue(this, auctionId) | |
77 | 77 | let organizer = getStringValue(this, (auctionId + "_organizer")) | |
78 | 78 | let winner = getString(this, (auctionId + "_winner")) | |
79 | 79 | let lotAssetId = getStringValue(this, (auctionId + "_lot_assetId")) | |
80 | 80 | let lotAmount = getIntegerValue(this, (auctionId + "_lot_amount")) | |
81 | 81 | let priceAssetId = getStringValue(this, (auctionId + "_priceAssetId")) | |
82 | 82 | let winAmount = getIntegerValue(this, (auctionId + "_winAmount")) | |
83 | 83 | let lotAsset = if ((lotAssetId == "WAVES")) | |
84 | 84 | then unit | |
85 | 85 | else fromBase58String(lotAssetId) | |
86 | 86 | let priceAsset = if (if ((priceAssetId == "WAVES")) | |
87 | 87 | then true | |
88 | 88 | else (priceAssetId == "")) | |
89 | 89 | then unit | |
90 | 90 | else fromBase58String(priceAssetId) | |
91 | 91 | let winnerAddr = addressFromStringValue(value(winner)) | |
92 | 92 | let organizerAddr = addressFromStringValue(value(organizer)) | |
93 | 93 | let betAmount = getInteger(this, ((auctionId + "_bidder_") + callerAddressStr)) | |
94 | 94 | if ((endHeight > lastBlock.height)) | |
95 | 95 | then throw("Auction is not finished yet") | |
96 | 96 | else if (!(isDefined(winner))) | |
97 | 97 | then if (isDefined(getString(this, (auctionId + "_lot_passed")))) | |
98 | 98 | then throw("Organizer has already got his lot back") | |
99 | 99 | else ScriptResult(WriteSet([DataEntry((auctionId + "_lot_passed"), organizer)]), TransferSet([ScriptTransfer(organizerAddr, lotAmount, lotAsset)])) | |
100 | 100 | else if (isDefined(getString(this, (auctionId + "_lot_passed")))) | |
101 | 101 | then throw("Lot is already passed to the winner, and organizer got his reward") | |
102 | 102 | else ScriptResult(WriteSet([DataEntry((auctionId + "_lot_passed"), toBase58String(winnerAddr.bytes))]), TransferSet([ScriptTransfer(winnerAddr, lotAmount, lotAsset), ScriptTransfer(organizerAddr, winAmount, priceAsset)])) | |
103 | 103 | } | |
104 | 104 | ||
105 | 105 |
github/deemru/w8io/026f985 29.02 ms ◑