tx · A3Q56WArTCQ5ySw86X9oFBwetu6TzVFrg8su9vrhHFzR

3N1PPoNT4epUSgdGwx1eNePsZjeYp5RUAcj:  -0.01400000 Waves

2019.06.22 21:30 [553616] smart account 3N1PPoNT4epUSgdGwx1eNePsZjeYp5RUAcj > SELF 0.00000000 Waves

{ "type": 13, "id": "A3Q56WArTCQ5ySw86X9oFBwetu6TzVFrg8su9vrhHFzR", "fee": 1400000, "feeAssetId": null, "timestamp": 1561228204584, "version": 1, "sender": "3N1PPoNT4epUSgdGwx1eNePsZjeYp5RUAcj", "senderPublicKey": "AomFdZHmK72gCbitdy7X2sUvNueScd3LhY9g2m7DJdo4", "proofs": [ "2XrYNa5QLd79YMrgSaSQN2c6Rp9r2xmhZ6qNQMfr5EnTBjxAmERkoKTuKviui8Yxv8Tb29tqyWPYAsGRhX69J3oL" ], "script": "base64:AAIDAAAAAAAAAAAAAAABAAAAABJtYXhBdWN0aW9uRHVyYXRpb24JAABoAAAAAgAAAAAAAAAFoAAAAAAAAAAAHgAAAAMAAAABaQEAAAAMc3RhcnRBdWN0aW9uAAAAAwAAAAhkdXJhdGlvbgAAAApzdGFydFByaWNlAAAADHByaWNlQXNzZXRJZAQAAAAJYXVjdGlvbklkCQACWAAAAAEIBQAAAAFpAAAADXRyYW5zYWN0aW9uSWQEAAAAEGF1Y3Rpb25FbmRIZWlnaHQJAABkAAAAAggFAAAACWxhc3RCbG9jawAAAAZoZWlnaHQFAAAACGR1cmF0aW9uBAAAAANwbXQJAQAAAAdleHRyYWN0AAAAAQgFAAAAAWkAAAAHcGF5bWVudAMJAABmAAAAAgUAAAAIZHVyYXRpb24FAAAAEm1heEF1Y3Rpb25EdXJhdGlvbgkAAAIAAAABCQABLAAAAAICAAAAKER1cmF0aW9uIGlzIHRvbyBsb25nLiBNdXN0IGJlIGxlc3MgdGhhbiAJAAGkAAAAAQUAAAASbWF4QXVjdGlvbkR1cmF0aW9uCQEAAAAIV3JpdGVTZXQAAAABCQAETAAAAAIJAQA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AABaQAAAAZjYWxsZXIJAQAAAAV2YWx1ZQAAAAEFAAAACWJldEFtb3VudAUAAAARYXVjdGlvblByaWNlQXNzZXQFAAAAA25pbAAAAAAWljL3", "chainId": 84, "height": 553616, "spentComplexity": 0 } View: original | compacted Prev: 2Nqme25Yr4F2MmrW5dtBssQdcXofhoDQdsHCS5aEFtoy Next: BH1pWCc5hg1NBDet9oVvecCVWT2NFmDc9w4BHnJf1N6C Full:
OldNewDifferences
11 {-# STDLIB_VERSION 3 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let maxAuctionDuration = (1440 * 30)
55
66 @Callable(i)
77 func startAuction (duration,startPrice,priceAssetId) = {
88 let auctionId = toBase58String(i.transactionId)
99 let auctionEndHeight = (lastBlock.height + duration)
1010 let pmt = extract(i.payment)
1111 if ((duration > maxAuctionDuration))
1212 then throw(("Duration is too long. Must be less than " + toString(maxAuctionDuration)))
1313 else WriteSet([DataEntry(auctionId, auctionEndHeight), DataEntry((auctionId + "_organizer"), toBase58String(i.caller.bytes)), DataEntry((auctionId + "_lot_assetId"), if (isDefined(pmt.assetId))
1414 then toBase58String(value(pmt.assetId))
1515 else "WAVES"), DataEntry((auctionId + "_lot_amount"), pmt.amount), DataEntry((auctionId + "_startPrice"), startPrice), DataEntry((auctionId + "_priceAssetId"), priceAssetId)])
1616 }
1717
1818
1919
2020 @Callable(i)
2121 func bid (auctionId) = {
2222 let pmt = extract(i.payment)
2323 let pmtAssetIdStr = if (isDefined(pmt.assetId))
2424 then toBase58String(value(pmt.assetId))
2525 else "WAVES"
2626 let callerAddressStr = toBase58String(i.caller.bytes)
2727 let auctionEndHeight = getIntegerValue(this, auctionId)
2828 let auctionPriceAssetId = getStringValue(this, (auctionId + "_priceAssetId"))
2929 let auctionWinAmount = getInteger(this, (auctionId + "_winAmount"))
3030 if ((lastBlock.height >= auctionEndHeight))
3131 then throw("Auction already finished")
3232 else if ((auctionPriceAssetId != pmtAssetIdStr))
3333 then throw((("Bid must be in asset '" + auctionPriceAssetId) + "'"))
3434 else if (if (isDefined(auctionWinAmount))
3535 then (value(auctionWinAmount) >= pmt.amount)
3636 else false)
3737 then throw(("Bid must be more then " + toString(pmt.amount)))
3838 else WriteSet([DataEntry(((auctionId + "_bidder_") + callerAddressStr), pmt.amount), DataEntry((auctionId + "_winner"), callerAddressStr), DataEntry((auctionId + "_winAmount"), pmt.amount)])
3939 }
4040
4141
4242
4343 @Callable(i)
4444 func withdraw (auctionId) = {
4545 let pmt = extract(i.payment)
4646 let pmtAssetIdStr = if (isDefined(pmt.assetId))
4747 then toBase58String(value(pmt.assetId))
4848 else "WAVES"
4949 let callerAddressStr = toBase58String(i.caller.bytes)
5050 let auctionEndHeight = getIntegerValue(this, auctionId)
5151 let auctionOrganizer = getStringValue(this, (auctionId + "_organizer"))
5252 let auctionWinner = getString(this, (auctionId + "_winner"))
5353 let auctionLotAssetId = getStringValue(this, (auctionId + "_lot_assetId"))
5454 let auctionLotAmount = getIntegerValue(this, (auctionId + "_lot_amount"))
5555 let auctionPriceAssetId = getStringValue(this, (auctionId + "_priceAssetId"))
5656 let auctionWinAmount = getIntegerValue(this, (auctionId + "_winAmount"))
5757 let auctionLotAsset = if ((auctionLotAssetId == "WAVES"))
5858 then unit
5959 else fromBase58String(auctionLotAssetId)
6060 let auctionPriceAsset = if (if ((auctionPriceAssetId == "WAVES"))
6161 then true
6262 else (auctionPriceAssetId == ""))
6363 then unit
6464 else fromBase58String(auctionPriceAssetId)
6565 let auctionWinnerAddr = addressFromStringValue(value(auctionWinner))
6666 let auctionOrganizerAddr = addressFromStringValue(value(auctionOrganizer))
6767 let betAmount = getInteger(this, ((auctionId + "_bidder_") + callerAddressStr))
6868 if ((auctionEndHeight > lastBlock.height))
6969 then throw("Auction is not finished yet")
7070 else if (!(isDefined(auctionWinner)))
7171 then if ((callerAddressStr == auctionOrganizer))
7272 then if (!(isDefined(getBoolean(this, (auctionId + "_lot_passed")))))
7373 then throw("You have already got your lot back")
7474 else ScriptResult(WriteSet([DataEntry((auctionId + "_lot_passed"), true)]), TransferSet([ScriptTransfer(i.caller, auctionLotAmount, auctionLotAsset)]))
7575 else throw("You haven't participate in this auction")
7676 else if (if ((callerAddressStr == auctionOrganizer))
7777 then true
7878 else (callerAddressStr == auctionWinner))
7979 then if (isDefined(getBoolean(this, (auctionId + "_lot_passed"))))
8080 then throw("Lot is already passed to the winner, and organizer got his reward")
8181 else ScriptResult(WriteSet([DataEntry((auctionId + "_lot_passed"), true)]), TransferSet([ScriptTransfer(auctionWinnerAddr, auctionLotAmount, auctionLotAsset), ScriptTransfer(auctionOrganizerAddr, auctionWinAmount, auctionPriceAsset)]))
8282 else if (!(isDefined(betAmount)))
8383 then throw("You didn't bid anything")
8484 else if (isDefined(getBoolean(this, (((auctionId + "_bidder_") + callerAddressStr) + "_return"))))
8585 then throw("You have already got your bid back")
8686 else ScriptResult(WriteSet([DataEntry((((auctionId + "_bidder_") + callerAddressStr) + "_return"), true)]), TransferSet([ScriptTransfer(i.caller, value(betAmount), auctionPriceAsset)]))
8787 }
8888
8989

github/deemru/w8io/169f3d6 
35.41 ms