tx · 55F1TTY5LEyZA8gSAa6sHPQVRDcvrj3oo4QEhKrWnixZ

3N8wF4ntF9niEgikocU8yb1UU9spbdCtWsh:  -0.01400000 Waves

2022.02.23 01:24 [1935460] smart account 3N8wF4ntF9niEgikocU8yb1UU9spbdCtWsh > SELF 0.00000000 Waves

{ "type": 13, "id": "55F1TTY5LEyZA8gSAa6sHPQVRDcvrj3oo4QEhKrWnixZ", "fee": 1400000, "feeAssetId": null, "timestamp": 1645568712299, "version": 2, "chainId": 84, "sender": "3N8wF4ntF9niEgikocU8yb1UU9spbdCtWsh", "senderPublicKey": "HD1V9wMeKPrrSPB7aVX6wDgfTgYayNB6vb7LHkVJZzvV", "proofs": [ "3YBVexWatvni1h2djUzLxqh652N9RJjhGYbD13G2LJPBKkQya8ZzFiP64ZREC9RXPmfsgdAhKTQ4uVinmtzcHtX6" ], "script": "base64:AAIDAAAAAAAAABMIARIFCgMBAQgSAwoBCBIDCgEIAAAAAQAAAAASbWF4QXVjdGlvbkR1cmF0aW9uAAAAAAAAAfpAAAAAAwAAAAFpAQAAAAxzdGFydEF1Y3Rpb24AAAADAAAACGR1cmF0aW9uAAAACnN0YXJ0UHJpY2UAAAAMcHJpY2VBc3NldElkBAAAAANwbXQJAQAAAAdleHRyYWN0AAAAAQgFAAAAAWkAAAAHcGF5bWVudAQAAAAJYXVjdGlvbklkCQACWAAAAAEIBQAAAAFpAAAADXRyYW5zYWN0aW9uSWQEAAAACWVuZEhlaWdodAkAAGQAAAACCAUAAAAJbGFzdEJsb2NrAAAABmhlaWdodAUAAAAIZHVyYXRpb24EAAAAC29yZ2FuaXNlcmlkCQACWAAAAAEICAUAAAABaQAAAAZjYWxsZXIAAAAFYnl0ZXMEAAAAD0F1Y3Rpb25kdXJhdGlvbgkBAAAACURhdGFFbnRyeQAAAAIFAAAACWF1Y3Rpb25JZAUAAAAJZW5kSGVpZ2h0BAAAAAlvcmdhbmlzZXIJAQAAAAlEYXRhRW50cnkAAAACCQABLAAAAAIFAAA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dF9wYXNzZWQJAAACAAAAAQIAAABBTG90IGlzIGFscmVhZHkgcGFzc2VkIHRvIHRoZSB3aW5uZXIsIGFuZCBvcmdhbml6ZXIgZ290IGhpcyByZXdhcmQJAQAAAAxTY3JpcHRSZXN1bHQAAAACCQEAAAAIV3JpdGVTZXQAAAABCQAETAAAAAIJAQAAAAlEYXRhRW50cnkAAAACCQABLAAAAAIFAAAACWF1Y3Rpb25JZAIAAAALX2xvdF9wYXNzZWQJAAJYAAAAAQgFAAAACndpbm5lckFkZHIAAAAFYnl0ZXMFAAAAA25pbAkBAAAAC1RyYW5zZmVyU2V0AAAAAQkABEwAAAACCQEAAAAOU2NyaXB0VHJhbnNmZXIAAAADBQAAAAp3aW5uZXJBZGRyBQAAAAlsb3RBbW91bnQFAAAACGxvdEFzc2V0CQAETAAAAAIJAQAAAA5TY3JpcHRUcmFuc2ZlcgAAAAMFAAAADW9yZ2FuaXplckFkZHIJAABpAAAAAgkAAGgAAAACBQAAAAl3aW5BbW91bnQAAAAAAAAAAF8AAAAAAAAAAGQFAAAACnByaWNlQXNzZXQJAARMAAAAAgkBAAAADlNjcmlwdFRyYW5zZmVyAAAAAwkBAAAAFGFkZHJlc3NGcm9tUHVibGljS2V5AAAAAQEAAAAgPbGudhoC2EmTbbT+1HzFYzykEopCrrlDCkRclNVlCm8JAABpAAAAAgkAAGgAAAACBQAAAAl3aW5BbW91bnQAAAAAAAAAAAUAAAAAAAAAAGQFAAAACnByaWNlQXNzZXQFAAAAA25pbAAAAAEAAAACdHgBAAAABnZlcmlmeQAAAAAJAAH0AAAAAwgFAAAAAnR4AAAACWJvZHlCeXRlcwkAAZEAAAACCAUAAAACdHgAAAAGcHJvb2ZzAAAAAAAAAAAACAUAAAACdHgAAAAPc2VuZGVyUHVibGljS2V5AXU5Gw==", "height": 1935460, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: AF3Uh5BTus5Nf5uBWTrHybrWt6x3K4CYTKGeoYr3TRMF Next: none Diff:
OldNewDifferences
2020 if ((duration > maxAuctionDuration))
2121 then throw(("Duration is too long. Must be less than " + toString(maxAuctionDuration)))
2222 else if ((1000 >= startPrice))
23- then throw("Auction StartPrice less than 0.001")
23+ then throw("Auction StartPrice less than 0.001 USDT.")
2424 else WriteSet([Auctionduration, organiser, lotassetid, lotamount, startprice, priceassetid])
2525 }
2626
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 3 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let maxAuctionDuration = 129600
55
66 @Callable(i)
77 func startAuction (duration,startPrice,priceAssetId) = {
88 let pmt = extract(i.payment)
99 let auctionId = toBase58String(i.transactionId)
1010 let endHeight = (lastBlock.height + duration)
1111 let organiserid = toBase58String(i.caller.bytes)
1212 let Auctionduration = DataEntry(auctionId, endHeight)
1313 let organiser = DataEntry((auctionId + "_organizer"), organiserid)
1414 let lotassetid = DataEntry((auctionId + "_lot_assetId"), if (isDefined(pmt.assetId))
1515 then toBase58String(value(pmt.assetId))
1616 else "WAVES")
1717 let lotamount = DataEntry((auctionId + "_lot_amount"), pmt.amount)
1818 let startprice = DataEntry((auctionId + "_startPrice"), startPrice)
1919 let priceassetid = DataEntry((auctionId + "_priceAssetId"), priceAssetId)
2020 if ((duration > maxAuctionDuration))
2121 then throw(("Duration is too long. Must be less than " + toString(maxAuctionDuration)))
2222 else if ((1000 >= startPrice))
23- then throw("Auction StartPrice less than 0.001")
23+ then throw("Auction StartPrice less than 0.001 USDT.")
2424 else WriteSet([Auctionduration, organiser, lotassetid, lotamount, startprice, priceassetid])
2525 }
2626
2727
2828
2929 @Callable(i)
3030 func bid (auctionId) = {
3131 let pmt = extract(i.payment)
3232 let pmtAssetIdStr = if (isDefined(pmt.assetId))
3333 then toBase58String(value(pmt.assetId))
3434 else "WAVES"
3535 let callerAddressStr = toBase58String(i.caller.bytes)
3636 let endHeight = getIntegerValue(this, auctionId)
3737 let startPrice = getIntegerValue(this, (auctionId + "_startPrice"))
3838 let priceAssetId = getStringValue(this, (auctionId + "_priceAssetId"))
3939 let winAmount = getInteger(this, (auctionId + "_winAmount"))
4040 let winner = getString(this, (auctionId + "_winner"))
4141 let bidFromTheSameUser = if (isDefined(winner))
4242 then (value(winner) == callerAddressStr)
4343 else false
4444 let totalBidAmount = (pmt.amount + (if (bidFromTheSameUser)
4545 then value(winAmount)
4646 else 0))
4747 if ((lastBlock.height >= endHeight))
4848 then throw("Auction already finished")
4949 else if ((priceAssetId != pmtAssetIdStr))
5050 then throw((("Bid must be in asset '" + priceAssetId) + "'"))
5151 else if (if (if (isDefined(winAmount))
5252 then (value(winAmount) >= totalBidAmount)
5353 else false)
5454 then true
5555 else if (!(isDefined(winAmount)))
5656 then (startPrice >= totalBidAmount)
5757 else false)
5858 then throw(("Bid must be more then " + toString(if (isDefined(winAmount))
5959 then value(winAmount)
6060 else startPrice)))
6161 else if (if (bidFromTheSameUser)
6262 then true
6363 else !(isDefined(winner)))
6464 then WriteSet([DataEntry((auctionId + "_winner"), callerAddressStr), DataEntry((auctionId + "_winAmount"), totalBidAmount)])
6565 else {
6666 let previousBidderAddr = addressFromStringValue(value(winner))
6767 let priceAsset = if (if ((priceAssetId == "WAVES"))
6868 then true
6969 else (priceAssetId == ""))
7070 then unit
7171 else fromBase58String(priceAssetId)
7272 ScriptResult(WriteSet([DataEntry((auctionId + "_winner"), callerAddressStr), DataEntry((auctionId + "_winAmount"), totalBidAmount)]), TransferSet([ScriptTransfer(previousBidderAddr, value(winAmount), priceAsset)]))
7373 }
7474 }
7575
7676
7777
7878 @Callable(i)
7979 func withdraw (auctionId) = {
8080 let pmt = extract(i.payment)
8181 let pmtAssetIdStr = if (isDefined(pmt.assetId))
8282 then toBase58String(value(pmt.assetId))
8383 else "WAVES"
8484 let callerAddressStr = toBase58String(i.caller.bytes)
8585 let endHeight = getIntegerValue(this, auctionId)
8686 let organizer = getStringValue(this, (auctionId + "_organizer"))
8787 let winner = getString(this, (auctionId + "_winner"))
8888 let lotAssetId = getStringValue(this, (auctionId + "_lot_assetId"))
8989 let lotAmount = getIntegerValue(this, (auctionId + "_lot_amount"))
9090 let priceAssetId = getStringValue(this, (auctionId + "_priceAssetId"))
9191 let winAmount = getIntegerValue(this, (auctionId + "_winAmount"))
9292 let lotAsset = if ((lotAssetId == "WAVES"))
9393 then unit
9494 else fromBase58String(lotAssetId)
9595 let priceAsset = if (if ((priceAssetId == "WAVES"))
9696 then true
9797 else (priceAssetId == ""))
9898 then unit
9999 else fromBase58String(priceAssetId)
100100 let winnerAddr = addressFromStringValue(value(winner))
101101 let organizerAddr = addressFromStringValue(value(organizer))
102102 let betAmount = getInteger(this, ((auctionId + "_bidder_") + callerAddressStr))
103103 if ((endHeight > lastBlock.height))
104104 then throw("Auction is not finished yet")
105105 else if (!(isDefined(winner)))
106106 then if (isDefined(getString(this, (auctionId + "_lot_passed"))))
107107 then throw("Organizer has already got his lot back")
108108 else ScriptResult(WriteSet([DataEntry((auctionId + "_lot_passed"), organizer)]), TransferSet([ScriptTransfer(organizerAddr, lotAmount, lotAsset)]))
109109 else if (isDefined(getString(this, (auctionId + "_lot_passed"))))
110110 then throw("Lot is already passed to the winner, and organizer got his reward")
111111 else ScriptResult(WriteSet([DataEntry((auctionId + "_lot_passed"), toBase58String(winnerAddr.bytes))]), TransferSet([ScriptTransfer(winnerAddr, lotAmount, lotAsset), ScriptTransfer(organizerAddr, ((winAmount * 95) / 100), priceAsset), ScriptTransfer(addressFromPublicKey(base58'59q1hHBmeQgfSRst9Dn52VTBbtCu4SQ7AujhGDjHCqn6'), ((winAmount * 5) / 100), priceAsset)]))
112112 }
113113
114114
115115 @Verifier(tx)
116116 func verify () = sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey)
117117

github/deemru/w8io/026f985 
28.35 ms